Add PSRDNoise implementations for 2D and 3D#9
Merged
paddy-exe merged 1 commit intopaddy-exe:mainfrom Mar 9, 2023
Merged
Conversation
paddy-exe
requested changes
Mar 9, 2023
Owner
paddy-exe
left a comment
There was a problem hiding this comment.
If the comment lines inside the shader code are removed and one blank line at the end of each file I can merge this :D thank you!
paddy-exe
approved these changes
Mar 9, 2023
Owner
|
Awesome work! Thanks :D |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds 2D and 3D versions of the excellent PSRDNoise algorithm.
Notes:
psrdnoise2-min.glslandpsrdnoise3-min.glslfiles. Only themat3initialization inpsrdnoise3had to be changed to match Godot's preferred matrix instantiation signature.psrdnoise. I've renamed them topsrdnoise2andpsrdnoise3so both can be imported without conflict.Both functions allow for a finalout vec2/3 gradientparameter. This is a very useful, but purely optional feature, but the signature will always require the user to provide a variable here, even if they don't use it, which is a little bit annoying. I'm not sure if Godot's shading language allows for making parameters optional? If not, I could provide additional overloads that do away with the parameter. Please let me know what you think.psrdnoise3andpsrdnoise3_with_gradient(and same for2) functions.Similarly,psrdnoise3.gdshaderincexports apermutefunction. The potential for namespace collisions (especially if you later want to add other noise implementations) is high. How should we proceed here? We should probably rename the function to something a little less generic — anything else?__psrdnoise3_permute. If there is anything else we should do with it, let me know.