paint: cleanup
This commit is contained in:
@@ -1,6 +1,27 @@
|
||||
|
||||
#include "../global.h"
|
||||
|
||||
char *attribute_node_vector(ui_node_t *node, ui_node_socket_t *socket) {
|
||||
if (socket == node->outputs->buffer[0]) { // Color
|
||||
if (parser_material_kong->context->allow_vcols) {
|
||||
node_shader_context_add_elem(parser_material_kong->context, "col", "short4norm"); // Vcols only for now
|
||||
return "input.vcolor";
|
||||
}
|
||||
else {
|
||||
return ("float3(0.0, 0.0, 0.0)");
|
||||
}
|
||||
}
|
||||
else { // Vector
|
||||
node_shader_context_add_elem(parser_material_kong->context, "tex", "short2norm"); // UVMaps only for now
|
||||
return "float3(tex_coord.x, tex_coord.y, 0.0)";
|
||||
}
|
||||
}
|
||||
|
||||
char *attribute_node_value(ui_node_t *node, ui_node_socket_t *socket) {
|
||||
node_shader_add_constant(parser_material_kong, "time: float", "_time");
|
||||
return "constants.time";
|
||||
}
|
||||
|
||||
void attribute_node_init() {
|
||||
|
||||
attribute_node_def = GC_ALLOC_INIT(ui_node_t, {.id = 0,
|
||||
@@ -75,24 +96,3 @@ void attribute_node_init() {
|
||||
any_map_set(parser_material_node_vectors, "ATTRIBUTE", attribute_node_vector);
|
||||
any_map_set(parser_material_node_values, "ATTRIBUTE", attribute_node_value);
|
||||
}
|
||||
|
||||
char *attribute_node_vector(ui_node_t *node, ui_node_socket_t *socket) {
|
||||
if (socket == node->outputs->buffer[0]) { // Color
|
||||
if (parser_material_kong->context->allow_vcols) {
|
||||
node_shader_context_add_elem(parser_material_kong->context, "col", "short4norm"); // Vcols only for now
|
||||
return "input.vcolor";
|
||||
}
|
||||
else {
|
||||
return ("float3(0.0, 0.0, 0.0)");
|
||||
}
|
||||
}
|
||||
else { // Vector
|
||||
node_shader_context_add_elem(parser_material_kong->context, "tex", "short2norm"); // UVMaps only for now
|
||||
return "float3(tex_coord.x, tex_coord.y, 0.0)";
|
||||
}
|
||||
}
|
||||
|
||||
char *attribute_node_value(ui_node_t *node, ui_node_socket_t *socket) {
|
||||
node_shader_add_constant(parser_material_kong, "time: float", "_time");
|
||||
return "constants.time";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user