Skip to content
Snippets Groups Projects
Commit 6b6202db authored by Pascal Engeler's avatar Pascal Engeler
Browse files

Corrected colourmap coord calculation for leveled heightmap

parent 8c158d48
No related branches found
No related tags found
No related merge requests found
......@@ -33,11 +33,17 @@ uniform int highlightingEnabled; //NEW
uniform vec2 highlightingPoint; //NEW
uniform float highlightingRadius; //NEW
//Leveling related uniforms
uniform mat4 modelSpaceRot;
uniform float originZ;
void main(){
vec3 position = aPos;
vec4 position_transformed = model * vec4(position, 1.0);
gl_Position = projection * view * position_transformed;
colorCoord = (aPos.z - minZ)/(maxZ-minZ);
//colorCoord = (aPos.z - minZ)/(maxZ-minZ);
vec4 pos_col = modelSpaceRot * (vec4(aPos, 1.) + vec4(0.0,0.0,-originZ,0.0)) + vec4(0.0,0.0,originZ,0.0);
colorCoord = (pos_col.z - minZ)/(maxZ-minZ);
vertexColor = vec4(position.z, 0.0, 0.0, 1.);
colorOverridden = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment