ShaderNode: Extract texture from SampleTexture

Add TextureData and TextureValue node
This commit is contained in:
Lynix
2020-05-28 10:50:38 +02:00
parent 6ff670f13f
commit eabb8a630d
9 changed files with 307 additions and 111 deletions

View File

@@ -0,0 +1 @@
#include <ShaderNode/DataTypes/TextureData.hpp>

View 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

View 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));
}