Hex Tiling - #1020
Conversation
0ef51e9 to
a51c01f
Compare
aHooder
left a comment
There was a problem hiding this comment.
Not much to change, but I think it would make sense to make a hex tiling bool to tightly packed as a flag in the material data UBO, and repurpose the otherwise unused texture scale floats instead of adding new fields. Also some comments & general questions 🙂
| }, | ||
| "hexTilingScale": { | ||
| "type": "number", | ||
| "description": "The scale of the hexagonal tiling pattern. Defaults to 0.0, i.e. no tiling." |
There was a problem hiding this comment.
It probably makes sense for this to be its own field & not directly tied to textureScale, but the description could be clearer about acting like both the toggle & scale of hex tiling.
There was a problem hiding this comment.
The scale should also be changed to behave similarly to textureScale, in that larger numbers mean larger appearance of the texture, since that way around is just more intuitive. The textureScale stuff does this by calculating the reciprocal during normalization if I remember correctly, or it might be during material UBO filling.
There was a problem hiding this comment.
Didn't touch the materialData flags since I'd like to move allot of those bits over to the ModelData struct once that is merged, also it kinda means there'd be two ways to disable hex tiling since a scale of 0 would break the sampling mode.
Edit: Ah you mean the Material Struct flags not the ModelOverride. That could work. but we'd still have the fact that scaling could break near 0
There was a problem hiding this comment.
Yeah, I should've specified. I was thinking we can keep hexTilingScale just as it is, default to zero, then whenever it's set to something non-zero, consider hex tiling as enabled, and set a flag in the existing flags in UBOMaterials. Then, since the shader now knows when to use hex tiling, we can repurpose the existing first float component of the textureScale, so we don't need to add a whole new hexTilingScale field to the material struct. The second component could be used for the hexTilingBlend. I suppose it's not really necessary, but I'm not too sure how far off the UBO size limit we currently are with materials either. Probably worth changing imo 👀
2edd149 to
d69b7af
Compare
Due to Tile Blending we call `buildHexData` per vertex, so move the derivative calculation to a shared struct which is lazy initialised

Uh oh!
There was an error while loading. Please reload this page.