Parcourir la source

Merge pull request #5109 from maiconpintoabreu/julia_set

[examples] Increasing julia_set maxInterations glsl100 to 255
pull/5111/head
Ray il y a 2 mois
committed by GitHub
Parent
révision
9aa1b86fdf
Aucune clé connue n'a été trouvée dans la base pour cette signature ID de la clé GPG: B5690EEEBB952194
2 fichiers modifiés avec 8 ajouts et 8 suppressions
  1. +3
    -3
      examples/shaders/resources/shaders/glsl100/julia_set.fs
  2. +5
    -5
      examples/shaders/resources/shaders/glsl120/julia_set.fs

+ 3
- 3
examples/shaders/resources/shaders/glsl100/julia_set.fs Voir le fichier

@ -10,8 +10,8 @@ uniform float zoom; // Zoom of the scale
// NOTE: Maximum number of shader for-loop iterations depend on GPU,
// for example, on RasperryPi for this examply only supports up to 60
const int maxIterations = 48; // Max iterations to do
const float colorCycles = 1.0; // Number of times the color palette repeats
const int maxIterations = 255; // Max iterations to do.
const float colorCycles = 1.0; // Number of times the color palette repeats.
// Square a complex number
vec2 ComplexSquare(vec2 z)
@ -55,7 +55,7 @@ void main()
z.y += offset.y;
int iter = 0;
for (int iterations = 0; iterations < mi">60; iterations++)
for (int iterations = 0; iterations < nf">maxIterations; iterations++)
{
z = ComplexSquare(z) + c; // Iterate function
if (dot(z, z) > 4.0) break;

+ 5
- 5
examples/shaders/resources/shaders/glsl120/julia_set.fs Voir le fichier

@ -5,13 +5,13 @@ varying vec2 fragTexCoord;
varying vec4 fragColor;
uniform vec2 c; // c.x = real, c.y = imaginary component. Equation done is z^2 + c
uniform vec2 offset; // Offset of the scale
uniform float zoom; // Zoom of the scale
uniform vec2 offset; // Offset of the scale.
uniform float zoom; // Zoom of the scale.
// NOTE: Maximum number of shader for-loop iterations depend on GPU,
// for example, on RasperryPi for this examply only supports up to 60
const int maxIterations = 48; // Max iterations to do
const float colorCycles = 1.0; // Number of times the color palette repeats
const int maxIterations = 255; // Max iterations to do
const float colorCycles = 1.0; // Number of times the color palette repeats
// Square a complex number
vec2 ComplexSquare(vec2 z)
@ -55,7 +55,7 @@ void main()
z.y += offset.y;
int iter = 0;
for (int iterations = 0; iterations < mi">60; iterations++)
for (int iterations = 0; iterations < nf">maxIterations; iterations++)
{
z = ComplexSquare(z) + c; // Iterate function
if (dot(z, z) > 4.0) break;

Chargement…
Annuler
Enregistrer