Skip to content

Commit

Permalink
w instances/wo instances fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandCsibrei committed Oct 25, 2023
1 parent b37f127 commit f1e3f51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export class GreasedLineSimpleMaterial extends ShaderMaterial implements IGrease
{
attributes,
uniforms: [
"world",
"viewProjection",
"view",
"projection",
Expand Down
8 changes: 6 additions & 2 deletions packages/dev/core/src/Shaders/greasedLine.vertex.fx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ void main() {
vec3 grlNext = grl_nextAndCounters.xyz;
grlCounters = grl_nextAndCounters.w;

mat4 grlMatrix = viewProjection * finalWorld;

#ifdef INSTANCES
mat4 grlMatrix = viewProjection * finalWorld ;
#else
mat4 grlMatrix = viewProjection * world ;
#endif

vec3 grlPositionOffset = grl_offsets;
vec4 grlFinalPosition = grlMatrix * vec4( position + grlPositionOffset , 1.0 );
vec4 grlPrevPos = grlMatrix * vec4( grlPrevious + grlPositionOffset, 1.0 );
Expand Down

0 comments on commit f1e3f51

Please sign in to comment.