This is to make the codegen and shading nodes object type agnostic. This is essential for flexibility of the engine to use the nodetree as it see fits. The essential volume attributes struct properties are moved to the `GPUMaterialAttribute` which see its final input name set on creation. The binding process is centralized into `draw_volume.cc` to avoid duplicating the code between multiple engines. It mimics the hair attributes process. Volume object grid transforms and other per object uniforms are packed into one UBO per object. The grid transform is now based on object which simplify the matrix preparations. This also gets rid of the double transforms and use object info orco factors for volume objects. Tagging @brecht because he did the initial implementation of Volume Grids.
23 lines
489 B
GLSL
23 lines
489 B
GLSL
|
|
void node_attribute_color(vec4 attr, out vec4 out_attr)
|
|
{
|
|
out_attr = attr_load_color_post(attr);
|
|
}
|
|
|
|
void node_attribute_temperature(vec4 attr, out vec4 out_attr)
|
|
{
|
|
out_attr.x = attr_load_temperature_post(attr.x);
|
|
out_attr.y = 0.0;
|
|
out_attr.z = 0.0;
|
|
out_attr.w = 1.0;
|
|
}
|
|
|
|
void node_attribute(
|
|
vec4 attr, out vec4 outcol, out vec3 outvec, out float outf, out float outalpha)
|
|
{
|
|
outcol = vec4(attr.xyz, 1.0);
|
|
outvec = attr.xyz;
|
|
outf = avg(attr.xyz);
|
|
outalpha = attr.w;
|
|
}
|