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

Fix the Julia set shader example #3467

Merged
merged 13 commits into from
Oct 29, 2023
Merged

Fix the Julia set shader example #3467

merged 13 commits into from
Oct 29, 2023

Conversation

joshcol9232
Copy link
Contributor

@joshcol9232 joshcol9232 commented Oct 25, 2023

A follow-up to #3466

Hello! Ever since I added the Julia set shader example (~4 years ago!) it had always bugged me that the zoom function was never correct. This PR fixes this, and is also a general tidy-up.

In summary:

  • Fix zoom issue.
  • Add a COLOR_CYCLES variable to the shader to allow for cycling of the color palette. This allows for finer details of the fractal to be shown when using a high max iteration number.
  • Allow user to reset the camera with "R".
  • Fix some pretty terrible if statement mess.
  • Other minor tidying (removal of unnecessary uniform value).
  • Update copyright.

Issue

Fixes: #3465

Testing

I have tested the code on my Linux machine. I have not tested on glsl100 platforms, or Windows.

examples/shaders/resources/shaders/glsl100/julia_set.fs Outdated Show resolved Hide resolved
examples/shaders/resources/shaders/glsl100/julia_set.fs Outdated Show resolved Hide resolved
examples/shaders/shaders_julia_set.c Outdated Show resolved Hide resolved
examples/shaders/shaders_julia_set.c Outdated Show resolved Hide resolved
@raysan5
Copy link
Owner

raysan5 commented Oct 26, 2023

@joshcol9232 Thanks for the improvement, added some possible points to review.

@joshcol9232
Copy link
Contributor Author

@raysan5 thank you for the timely review; I've updated given the comments and also tidied elsewhere in the code where the coding conventions were not being followed. Thanks!

@raysan5 raysan5 merged commit 975d415 into raysan5:master Oct 29, 2023
12 checks passed
@raysan5
Copy link
Owner

raysan5 commented Oct 29, 2023

@joshcol9232 thanks for the review!

@joshcol9232 joshcol9232 deleted the fix_zoom branch October 29, 2023 15:44
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.

[example] The zoom in the Julia set example is not correct
2 participants