refactor(rendering)!: migrate chunk vertex attribute changes#4735
Conversation
|
so this should be a first pass on this logic. we probably want to tweak this more. |
…ks/Terasology into refactor/rendering-migrate-chunk-vertex-attribute
|
here is how I get this to work under renderdoc I've just been building the project in intellij and executing |
jdrueckert
left a comment
There was a problem hiding this comment.
Works on my machine, but there's some minor issues
| //bool checkFlag(int flag, float val) { | ||
| // return val > float(flag) - 0.5 && val < float(flag) + 0.5; | ||
| //} |
There was a problem hiding this comment.
if we don't use this anymore, can we remove it?
| //bool checkFlag(uint flag, uint val) { | ||
| // return flag == val; | ||
| //} |
| #if defined (NORMAL_MAPPING) | ||
| normalMatrix = gl_NormalMatrix; | ||
| worldSpaceNormal = gl_Normal; | ||
| // normalMatrix = in_normal; |
| vertexWorldPos = in_vert + chunkPositionWorld.xyz; | ||
|
|
||
| if (in_frames > 0) { |
| sunVecView = (modelViewMatrix * vec4(sunVec.x, sunVec.y, sunVec.z, 0.0)).xyz; | ||
|
|
||
| isUpside = in_normal.y > 0.9 ? 1 : 0; |
| gl_Position = projectionMatrix * modelViewMatrix * vec4(in_vert, 1.0); | ||
| v_pos = gl_Position; |
| varying vec3 worldSpaceNormal; | ||
| varying mat3 normalMatrix; | ||
| out vec3 worldSpaceNormal; | ||
| //out mat3 normalMatrix; |
| public final VertexAttributeBinding<Vector3fc, Vector3f> position; | ||
| public final VertexAttributeBinding<Vector3fc, Vector3f> normals; | ||
| public final VertexAttributeBinding<Vector2fc, Vector2f> uv0; | ||
| // public final VertexAttributeBinding<Colorc, Color> color; // color data is unused |
There was a problem hiding this comment.
I want to keep a note here because we had color data that we're not using. I guess the plan was to have colored lights of some kind :?
There was a problem hiding this comment.
There were beautiful colored torches long ago, in either case. This might have been left in place by somebody disabling them "temporarily" hoping they'd be back?
|
here is how I get this to work under renderdoc I've just been building the project in intellij and executing |
* refactor(rendering)!: update chunk rendering logic with changes PR: MovingBlocks/Terasology#4735 * chore: clean up states changes in chunkmesh

This migrates chunkMesh to take advantage of this attribute scheme. I also migrated the code to take advantage of GLSL 330. There isn't really any significant performance changes from what I can tell. one nice thing about this change is that renderdoc is able to properly render frames from the game with debug information about incoming vertices and different state of the rendering peipline. should make it easier to debug our render pipeline.
PR: Terasology/CoreRendering#59
looks like we don't really take good advantage of the depth pass well. most of the texture is unused from what I can tell.
