Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/corelibs/cgl/rendertargets.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class RenderTargets
else if (type == "Position * ModelView") return " " + outcolor + i + " = vec4(MOD_pos_mv,1.);".endl();

else if (type == "Position Object") return " " + outcolor + i + " = vec4(MOD_pos_object,1.);".endl();
else if (type == "Normal World") return " " + outcolor + i + " = vec4(MOD_normal_world,1.);".endl();
else if (type == "Normal World") return " " + outcolor + i + " = vec4(normalize(MOD_normal_world),1.);".endl();
else if (type == "Normal * ModelView") return " " + outcolor + i + " = vec4(MOD_normal_mv,1.);".endl();
else if (type == "Material Id") return " " + outcolor + i + " = vec4(round(materialId),round(instIdx),0.,1.);".endl();
else if (type == "Object Id") return " " + outcolor + i + " = vec4(objectId,0.,0.,1.);".endl();
Expand Down
11 changes: 10 additions & 1 deletion src/corelibs/cgl/rendertargets_slots.vert
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@


#ifdef MOD_SLOT_POS_NORMAL_WORLD
MOD_normal_world=(mMatrix*vec4(norm,1.0)).xyz;
mat4 MOD_fmMatrix=mMatrix;
#ifdef INSTANCING
#ifdef TEXINSTMAT
MOD_fmMatrix = texInstMat;
#endif
#ifndef TEXINSTMAT
MOD_fmMatrix = iMat;
#endif
#endif
MOD_normal_world=vec3(MOD_fmMatrix * vec4(norm, 0.0));
#endif

Loading