Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/shaders/object_motion_vert.glsl
| Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | #ifdef HAIR | ||||
| vec3 nxt = texelFetch(nxtBuffer, id).point_position; | vec3 nxt = texelFetch(nxtBuffer, id).point_position; | ||||
| #endif | #endif | ||||
| prevWorldPos = (prevModelMatrix * vec4(useDeform ? prv : pos, 1.0)).xyz; | prevWorldPos = (prevModelMatrix * vec4(useDeform ? prv : pos, 1.0)).xyz; | ||||
| currWorldPos = (currModelMatrix * vec4(pos, 1.0)).xyz; | currWorldPos = (currModelMatrix * vec4(pos, 1.0)).xyz; | ||||
| nextWorldPos = (nextModelMatrix * vec4(useDeform ? nxt : pos, 1.0)).xyz; | nextWorldPos = (nextModelMatrix * vec4(useDeform ? nxt : pos, 1.0)).xyz; | ||||
| /* Use jittered projmatrix to be able to match exact sample depth (depth equal test). | /* Use jittered projmatrix to be able to match exact sample depth (depth equal test). | ||||
| * Note that currModelMatrix needs to also be equal to ModelMatrix for the samples to match. */ | * Note that currModelMatrix needs to also be equal to ModelMatrix for the samples to match. */ | ||||
| #ifndef HAIR | #ifndef HAIR | ||||
| gl_Position = ViewProjectionMatrix * vec4(currWorldPos, 1.0); | gl_Position = ProjectionMatrix * (ViewMatrix * vec4(currWorldPos, 1.0)); | ||||
| #else | #else | ||||
| gl_Position = ViewProjectionMatrix * vec4(wpos, 1.0); | gl_Position = ProjectionMatrix * (ViewMatrix * vec4(wpos, 1.0)); | ||||
| #endif | #endif | ||||
| } | } | ||||