-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(rendering)!: migrate chunk vertex attribute changes #4735
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we don't use this anymore, can we remove it?
//bool checkFlag(uint flag, uint val) { | ||
// return flag == val; | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
|
||
#if defined (NORMAL_MAPPING) | ||
normalMatrix = gl_NormalMatrix; | ||
worldSpaceNormal = gl_Normal; | ||
// normalMatrix = in_normal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be removed?
vertexWorldPos = in_vert + chunkPositionWorld.xyz; | ||
|
||
if (in_frames > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there seem to be tabs here
sunVecView = (modelViewMatrix * vec4(sunVec.x, sunVec.y, sunVec.z, 0.0)).xyz; | ||
|
||
isUpside = in_normal.y > 0.9 ? 1 : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
gl_Position = projectionMatrix * modelViewMatrix * vec4(in_vert, 1.0); | ||
v_pos = gl_Position; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tabs
varying vec3 worldSpaceNormal; | ||
varying mat3 normalMatrix; | ||
out vec3 worldSpaceNormal; | ||
//out mat3 normalMatrix; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.