#pragma once #ifndef NAZARA_SHADERNODES_SAMPLETEXTURE_HPP #define NAZARA_SHADERNODES_SAMPLETEXTURE_HPP #include #include #include #include #include #include #include class SampleTexture : public ShaderNode { public: SampleTexture(ShaderGraph& graph); ~SampleTexture() = default; Nz::ShaderNodes::NodePtr BuildNode(Nz::ShaderNodes::ExpressionPtr* expressions, std::size_t count, std::size_t outputIndex) const override; QString caption() const override { return "Sample texture"; } QString name() const override { return "SampleTexture"; } unsigned int nPorts(QtNodes::PortType portType) const override; QtNodes::NodeDataType dataType(QtNodes::PortType portType, QtNodes::PortIndex portIndex) const override; QString portCaption(QtNodes::PortType portType, QtNodes::PortIndex portIndex) const override; bool portCaptionVisible(QtNodes::PortType portType, QtNodes::PortIndex portIndex) const override; std::shared_ptr outData(QtNodes::PortIndex port) override; void setInData(std::shared_ptr value, int index) override; QtNodes::NodeValidationState validationState() const override; QString validationMessage() const override; protected: bool ComputePreview(QPixmap& pixmap) override; void UpdateOutput(); std::shared_ptr m_texture; std::shared_ptr m_uv; std::shared_ptr m_output; }; #include #endif