1#include "Shading/ShaderNodes/BakeToSlotNode.h"
7 if(inputPins[0]->IsLinked())
10 inputPins[0]->other->Evaluate(GetParams(function, &tmp));
11 function->AddLine(
GLSLLine(
"textureBakeSlots[int(" + SDATA(0) +
")] = " + tmp.line +
";"));
12 line->line = tmp.line;
16 function->AddLine(
GLSLLine(
"textureBakeSlots[int(" + SDATA(0) +
")] = vec3(0.0f);"));
17 line->line =
"vec3(0.0f)";
29 data[
"type"] =
"BakeToSlot";
34void BakeToSlotNode::UpdateShaders()
36 sharedData->d0 =
static_cast<float>(slot);
39void BakeToSlotNode::OnRender()
41 DrawHeader(
"Bake to Slot");
42 ImGui::PushItemWidth(100);
45 inputPins[0]->Render();
47 if(ImGui::InputInt(
"Slot", &slot))
49 sharedData->d0 =
static_cast<float>(slot);
52 outputPins[0]->Render();
56 ImGui::TextColored(ImVec4(7.0f, 0.0, 0.0f, 1.0f),
"Slot 0 is reserved for Height Map!");
59 if(slot < 0 || slot > 10)
64 ImGui::PopItemWidth();
70 name =
"Bake To Slot";
72 headerColor = ImColor(SHADER_VALUE_NODE_COLOR);
73 outputPins.push_back(
new SNEPin(NodeEditorPinType::Output, SNEPinType::SNEPinType_Float3));
74 inputPins.push_back(
new SNEPin(NodeEditorPinType::Input, SNEPinType::SNEPinType_Float3));
78BakeToSlotNode::~BakeToSlotNode()
a class to store JSON values