Skip to content
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

Add detiling option to the shader #145

Closed
TokisanGames opened this issue Jul 21, 2023 · 5 comments · Fixed by #365
Closed

Add detiling option to the shader #145

TokisanGames opened this issue Jul 21, 2023 · 5 comments · Fixed by #365
Labels
enhancement New feature or request
Milestone

Comments

@TokisanGames
Copy link
Owner

The current rotation used for detiling is very unattractive for strong patterns like rock, and it is questionable for weak patterns like grass/mud. One user mentioned rotation messes up normals.

I think we should differentiate between detiling and rotation and make these changes:

  • (This Issue) Include a better detiling algorithm, such as one of these from IQ, or one from hterrain. Either are superior to the current implementation.

  • (Separate issue) Include paintable rotation in our control map so we can manually paint rotated textures like cobblestone paths and orient them properly.

See proposed control map #64 (comment)
Related to #97
This should also address #69

@TokisanGames TokisanGames added the enhancement New feature or request label Jul 21, 2023
@TokisanGames TokisanGames added this to the Stable milestone Jul 21, 2023
@outobugi
Copy link
Collaborator

We probably can change the de-tiling but it will be a lot slower than our current one. Our method utilizes the index blending and the de-tiling is basically free. Most de-tiling methods use noisy patterns and ours is a grid. We would need to check if neighboring indices are same, skip them and do the de-tiling. See updated #64

@outobugi outobugi added the help wanted Help from other contributors desired label Jul 23, 2023
@TokisanGames TokisanGames changed the title Replace rotation with detiling Add detiling option to the shader Feb 8, 2024
@TokisanGames TokisanGames removed the help wanted Help from other contributors desired label Mar 28, 2024
@Xtarsia
Copy link
Contributor

Xtarsia commented Apr 17, 2024

image

Godot_v4.3-dev5_win64_b1fMAhZ0Ee.mp4

Along side Per Texture, UV Scale & UV Rotation;
a UV Rotation Blend value would be very handy. (some textures need hardly any at all, making de-tiling almost free for those cases)

Currently as implemented the performance hit to enable de-tiling is between 5-15% increase in sample reads.
The limit if setting blend to absolute maxium is 100% (double) but anything past 20% is kind of redundant.

and note 1 optimisation as im typing this: can disable when blend value is at maxium)

(some minor optimisations / refactoring to fit with the rest of the base shader aside)

@JekSun97
Copy link

We probably can change the de-tiling but it will be a lot slower than our current one. Our method utilizes the index blending and the de-tiling is basically free. Most de-tiling methods use noisy patterns and ours is a grid. We would need to check if neighboring indices are same, skip them and do the de-tiling. See updated #64

Please do not add anything that will worsen optimization

@TokisanGames
Copy link
Owner Author

This is already completed. See the end of this video. https://x.com/TokisanGames/status/1793957324069158955?t=xkVLzEQiI453cZVojmmBbA&s=19

@JekSun97
Copy link

This is already completed. See the end of this video. https://x.com/TokisanGames/status/1793957324069158955?t=xkVLzEQiI453cZVojmmBbA&s=19

Wow! it is excellent! As far as I know, this doesn't even exist in Unity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants