mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-22 23:29:18 -05:00
Merge pull request #5109 from maiconpintoabreu/julia_set
[examples] Increasing julia_set maxInterations glsl100 to 255
This commit is contained in:
@ -10,8 +10,8 @@ uniform float zoom; // Zoom of the scale
|
|||||||
|
|
||||||
// NOTE: Maximum number of shader for-loop iterations depend on GPU,
|
// NOTE: Maximum number of shader for-loop iterations depend on GPU,
|
||||||
// for example, on RasperryPi for this examply only supports up to 60
|
// for example, on RasperryPi for this examply only supports up to 60
|
||||||
const int maxIterations = 48; // Max iterations to do
|
const int maxIterations = 255; // Max iterations to do.
|
||||||
const float colorCycles = 1.0; // Number of times the color palette repeats
|
const float colorCycles = 1.0; // Number of times the color palette repeats.
|
||||||
|
|
||||||
// Square a complex number
|
// Square a complex number
|
||||||
vec2 ComplexSquare(vec2 z)
|
vec2 ComplexSquare(vec2 z)
|
||||||
@ -55,7 +55,7 @@ void main()
|
|||||||
z.y += offset.y;
|
z.y += offset.y;
|
||||||
|
|
||||||
int iter = 0;
|
int iter = 0;
|
||||||
for (int iterations = 0; iterations < 60; iterations++)
|
for (int iterations = 0; iterations < maxIterations; iterations++)
|
||||||
{
|
{
|
||||||
z = ComplexSquare(z) + c; // Iterate function
|
z = ComplexSquare(z) + c; // Iterate function
|
||||||
if (dot(z, z) > 4.0) break;
|
if (dot(z, z) > 4.0) break;
|
||||||
|
|||||||
@ -5,13 +5,13 @@ varying vec2 fragTexCoord;
|
|||||||
varying vec4 fragColor;
|
varying vec4 fragColor;
|
||||||
|
|
||||||
uniform vec2 c; // c.x = real, c.y = imaginary component. Equation done is z^2 + c
|
uniform vec2 c; // c.x = real, c.y = imaginary component. Equation done is z^2 + c
|
||||||
uniform vec2 offset; // Offset of the scale
|
uniform vec2 offset; // Offset of the scale.
|
||||||
uniform float zoom; // Zoom of the scale
|
uniform float zoom; // Zoom of the scale.
|
||||||
|
|
||||||
// NOTE: Maximum number of shader for-loop iterations depend on GPU,
|
// NOTE: Maximum number of shader for-loop iterations depend on GPU,
|
||||||
// for example, on RasperryPi for this examply only supports up to 60
|
// for example, on RasperryPi for this examply only supports up to 60
|
||||||
const int maxIterations = 48; // Max iterations to do
|
const int maxIterations = 255; // Max iterations to do
|
||||||
const float colorCycles = 1.0; // Number of times the color palette repeats
|
const float colorCycles = 1.0; // Number of times the color palette repeats
|
||||||
|
|
||||||
// Square a complex number
|
// Square a complex number
|
||||||
vec2 ComplexSquare(vec2 z)
|
vec2 ComplexSquare(vec2 z)
|
||||||
@ -55,7 +55,7 @@ void main()
|
|||||||
z.y += offset.y;
|
z.y += offset.y;
|
||||||
|
|
||||||
int iter = 0;
|
int iter = 0;
|
||||||
for (int iterations = 0; iterations < 60; iterations++)
|
for (int iterations = 0; iterations < maxIterations; iterations++)
|
||||||
{
|
{
|
||||||
z = ComplexSquare(z) + c; // Iterate function
|
z = ComplexSquare(z) + c; // Iterate function
|
||||||
if (dot(z, z) > 4.0) break;
|
if (dot(z, z) > 4.0) break;
|
||||||
|
|||||||
Reference in New Issue
Block a user