-
Notifications
You must be signed in to change notification settings - Fork 23
Coronas, ground curvature, glowing materials #513
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0a8cb83
Preliminary attempt at coronas, ground curve
rherriman 77b2221
Merge branch 'main' into rendering-improvements
rherriman 19cfed0
Add glow to materials
rherriman 7f2a6b8
Glow back to uint8 in vertex array, reserve slots
rherriman ee573c8
Fix bug with baked glow in BSPs, kill ground curve
rherriman 4c02529
Slight cleanups
rherriman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,26 @@ | ||
| layout(location = 0) in vec3 vertexPosition_modelspace; | ||
| layout(location = 1) in vec4 vertexColor; | ||
| layout(location = 2) in vec4 vertexSpecular; | ||
| layout(location = 3) in vec3 vertexNormal; | ||
| layout(location = 3) in float vertexGlow; | ||
| layout(location = 4) in float vertexReserved1; | ||
| layout(location = 5) in float vertexReserved2; | ||
| layout(location = 6) in float vertexReserved3; | ||
| layout(location = 7) in vec3 vertexNormal; | ||
|
|
||
| uniform mat4 view; | ||
| uniform mat4 proj; | ||
| uniform mat4 model; | ||
|
|
||
| out vec4 fragmentColor; | ||
| out vec4 fragmentSpecular; | ||
| out float fragmentGlow; | ||
| out vec3 fragmentNormal; | ||
|
|
||
| void main() { | ||
| vec4 pos = vec4(vertexPosition_modelspace, 1.0); | ||
| gl_Position = proj * (pos * model * view); | ||
| fragmentColor = vertexColor; | ||
| fragmentSpecular = vertexSpecular; | ||
| fragmentGlow = vertexGlow; | ||
| fragmentNormal = vertexNormal; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,5 +45,5 @@ class CWorldShader { | |
|
|
||
|
|
||
| CWorldShader(); | ||
| virtual void Reset(); | ||
| void Reset(); | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 should either fix this line to just use the raw vertexGlow (and remove maxGlow from the shader entirely), or go ahead and replace the single 32-bit float in the vertex array with four uint8_t's similar to how specular/shininess are stored and follow that pattern. That would mean 3 uint8_t's would be "reserved" for additional material properties in the future.
I don't love that plan, but ultimately, it's occupying exactly the same amount of space as it is currently.
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.
...it also occurs to me that maybe simply reordering the layout of the struct would rectify the issue I was seeing. If I put all the floats at the beginning and the uint8_t's at the end, I don't believe I'll have the same padding issues.
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.
Actually what am I saying, it's an array of these vertices, there will still be padding issues unless I reserve the padding explicitly.