This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/draw/intern/shaders/common_attribute_lib.glsl
Clément Foucault e48a6fcc63 DRW-Next: Add uniform attributes (object attributes) support
This replaces the direct shader uniform layout declaration by a linear
search through a global buffer.

Each instance has an attribute offset inside the global buffer and an
attribute count.

This removes any padding and tighly pack all uniform attributes inside
a single buffer.

This would also remove the limit of 8 attribute but it is kept because of
compatibility with the old system that is still used by the old draw
manager.
2022-09-02 19:37:15 +02:00

29 lines
947 B
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);
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);
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);
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);
vec4 attr_load_uniform(vec4 attr, const uint attr_hash);