Skip to content

Hex Tiling - #1020

Open
RuffledPlume wants to merge 7 commits into
117HD:masterfrom
RuffledPlume:HexTiling
Open

Hex Tiling#1020
RuffledPlume wants to merge 7 commits into
117HD:masterfrom
RuffledPlume:HexTiling

Conversation

@RuffledPlume

@RuffledPlume RuffledPlume commented Mar 22, 2026

Copy link
Copy Markdown
Contributor
Base Sampling Hex Tiling Sampling
image image

@RuffledPlume
RuffledPlume force-pushed the HexTiling branch 10 times, most recently from 0ef51e9 to a51c01f Compare March 27, 2026 17:29

@aHooder aHooder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 🙂

Comment thread schemas/materials.schema.json Outdated
},
"hexTilingScale": {
"type": "number",
"description": "The scale of the hexagonal tiling pattern. Defaults to 0.0, i.e. no tiling."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@RuffledPlume RuffledPlume Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 👀

Comment thread schemas/materials.schema.json Outdated
Comment thread src/main/resources/rs117/hd/scene_frag.glsl Outdated
Comment thread src/main/resources/rs117/hd/utils/hex_tiling.glsl
@RuffledPlume
RuffledPlume force-pushed the HexTiling branch 2 times, most recently from 2edd149 to d69b7af Compare July 25, 2026 02:55
@3-X

3-X commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Tested on MacOS this works without any issues
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants