Coronas, ground curvature, glowing materials#513
Conversation
| fragmentColor = vertexColor; | ||
| fragmentSpecular = vertexSpecular.rgb; | ||
| fragmentShininess = vertexSpecular.a * maxShininess; | ||
| fragmentGlow = vertexGlow * maxGlow; |
There was a problem hiding this comment.
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.
...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.
Actually what am I saying, it's an array of these vertices, there will still be padding issues unless I reserve the padding explicitly.
|
I decided to go ahead and make glow a uint8_t in the vertex array after all, and reserving three additional spots for material parameters. Normally I would be against wasting space like this, but I justified it thusly:
|
No description provided.