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.
34 lines
1.1 KiB
GLSL
34 lines
1.1 KiB
GLSL
|
|
/* Prototype of functions to implement to load attributes data.
|
|
* Implementation changes based on object data type. */
|
|
|
|
vec3 attr_load_orco(vec4 orco);
|
|
vec4 attr_load_tangent(vec4 tangent);
|
|
vec3 attr_load_uv(vec3 uv);
|
|
vec4 attr_load_color(vec4 color);
|
|
vec4 attr_load_vec4(vec4 attr);
|
|
vec3 attr_load_vec3(vec3 attr);
|
|
vec2 attr_load_vec2(vec2 attr);
|
|
float attr_load_float(float attr);
|
|
|
|
vec3 attr_load_orco(samplerBuffer orco);
|
|
vec4 attr_load_tangent(samplerBuffer tangent);
|
|
vec3 attr_load_uv(samplerBuffer uv);
|
|
vec4 attr_load_color(samplerBuffer color);
|
|
vec4 attr_load_vec4(samplerBuffer attr);
|
|
vec3 attr_load_vec3(samplerBuffer attr);
|
|
vec2 attr_load_vec2(samplerBuffer attr);
|
|
float attr_load_float(samplerBuffer attr);
|
|
|
|
vec3 attr_load_orco(sampler3D orco);
|
|
vec4 attr_load_tangent(sampler3D tangent);
|
|
vec3 attr_load_uv(sampler3D attr);
|
|
vec4 attr_load_color(sampler3D tex);
|
|
vec4 attr_load_vec4(sampler3D tex);
|
|
vec3 attr_load_vec3(sampler3D tex);
|
|
vec2 attr_load_vec2(sampler3D tex);
|
|
float attr_load_float(sampler3D tex);
|
|
|
|
float attr_load_temperature_post(float attr);
|
|
vec4 attr_load_color_post(vec4 attr);
|