Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/shaders/gpu_shader_material.glsl
| Show First 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | void geom(vec3 co, vec3 nor, mat4 viewinvmat, vec3 attorco, vec2 attuv, vec4 attvcol, out vec3 global, out vec3 local, out vec3 view, out vec3 orco, out vec3 uv, out vec3 normal, out vec4 vcol, out float vcol_alpha, out float frontback) | ||||
| orco = attorco; | orco = attorco; | ||||
| uv_attribute(attuv, uv); | uv_attribute(attuv, uv); | ||||
| normal = -normalize(nor); /* blender render normal is negated */ | normal = -normalize(nor); /* blender render normal is negated */ | ||||
| vcol_attribute(attvcol, vcol); | vcol_attribute(attvcol, vcol); | ||||
| vcol_alpha = attvcol.a; | vcol_alpha = attvcol.a; | ||||
| frontback = (gl_FrontFacing)? 1.0: 0.0; | frontback = (gl_FrontFacing)? 1.0: 0.0; | ||||
| } | } | ||||
| void particle_info(vec4 sprops, vec3 loc, vec3 vel, vec3 avel, out float index, out float age, out float life_time, out vec3 location, out float size, out vec3 velocity, out vec3 angular_velocity) | |||||
| { | |||||
| index = sprops.x; | |||||
| age = sprops.y; | |||||
| life_time = sprops.z; | |||||
| size = sprops.w; | |||||
| location = loc; | |||||
| velocity = vel; | |||||
| angular_velocity = avel; | |||||
| } | |||||
| void mapping(vec3 vec, mat4 mat, vec3 minvec, vec3 maxvec, float domin, float domax, out vec3 outvec) | void mapping(vec3 vec, mat4 mat, vec3 minvec, vec3 maxvec, float domin, float domax, out vec3 outvec) | ||||
| { | { | ||||
| outvec = (mat * vec4(vec, 1.0)).xyz; | outvec = (mat * vec4(vec, 1.0)).xyz; | ||||
| if(domin == 1.0) | if(domin == 1.0) | ||||
| outvec = max(outvec, minvec); | outvec = max(outvec, minvec); | ||||
| if(domax == 1.0) | if(domax == 1.0) | ||||
| outvec = min(outvec, maxvec); | outvec = min(outvec, maxvec); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 2,432 Lines • Show Last 20 Lines | |||||