nodes: made changes to the node system to allow for context sensitive shader code
Primarily implemented for the math node so a new shader can be generated and compiled based on what inputs the node is receiving.
This commit is contained in:
@@ -17,7 +17,26 @@ public:
|
||||
|
||||
virtual void Retranslate() override;
|
||||
|
||||
virtual Capabilities GetCapabilities(const NodeValueDatabase&) const override;
|
||||
virtual QString ShaderID(const NodeValueDatabase&) const override;
|
||||
virtual QString ShaderFragmentCode(const NodeValueDatabase&) const override;
|
||||
|
||||
virtual NodeValue InputValueFromTable(NodeInput* input, const NodeValueTable& table) const override;
|
||||
|
||||
private:
|
||||
enum Operation {
|
||||
kOpAdd,
|
||||
kOpSubtrack,
|
||||
kOpMultiply,
|
||||
kOpDivide
|
||||
};
|
||||
|
||||
static NodeParam::DataType GuessTypeFromTable(const NodeValueTable& table);
|
||||
|
||||
static QString GetUniformTypeFromType(const NodeParam::DataType& type);
|
||||
|
||||
static QString GetVariableCall(const QString& input_id, const NodeParam::DataType& type);
|
||||
|
||||
NodeInput* method_in_;
|
||||
|
||||
NodeInput* param_a_in_;
|
||||
|
||||
Reference in New Issue
Block a user