ShaderNode: Extract texture from SampleTexture
Add TextureData and TextureValue node
This commit is contained in:
1
src/ShaderNode/DataTypes/TextureData.cpp
Normal file
1
src/ShaderNode/DataTypes/TextureData.cpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <ShaderNode/DataTypes/TextureData.hpp>
|
||||
32
src/ShaderNode/DataTypes/TextureData.hpp
Normal file
32
src/ShaderNode/DataTypes/TextureData.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_SHADERNODES_TEXTUREDATA_HPP
|
||||
#define NAZARA_SHADERNODES_TEXTUREDATA_HPP
|
||||
|
||||
#include <Nazara/Renderer/ShaderAst.hpp>
|
||||
#include <nodes/NodeData>
|
||||
#include <QtGui/QImage>
|
||||
|
||||
struct TextureData : public QtNodes::NodeData
|
||||
{
|
||||
inline TextureData();
|
||||
|
||||
QImage preview;
|
||||
};
|
||||
|
||||
struct Texture2Data : public TextureData
|
||||
{
|
||||
QtNodes::NodeDataType type() const override
|
||||
{
|
||||
return Type();
|
||||
}
|
||||
|
||||
static QtNodes::NodeDataType Type()
|
||||
{
|
||||
return { "tex2d", "Texture2D" };
|
||||
}
|
||||
};
|
||||
|
||||
#include <ShaderNode/DataTypes/TextureData.inl>
|
||||
|
||||
#endif
|
||||
7
src/ShaderNode/DataTypes/TextureData.inl
Normal file
7
src/ShaderNode/DataTypes/TextureData.inl
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <ShaderNode/DataTypes/TextureData.hpp>
|
||||
|
||||
inline TextureData::TextureData() :
|
||||
preview(64, 64, QImage::Format_RGBA8888)
|
||||
{
|
||||
preview.fill(QColor::fromRgb(255, 255, 255, 0));
|
||||
}
|
||||
Reference in New Issue
Block a user