Pages

marți, 8 noiembrie 2022

Shader Editor - example 003.

Today I will show you how to change a shader from shadertoy website to a shader for Shader Editor android aplication.
Open my shader example from shader toy website.
#define f length(fract(q*=m*=.6+.1*d++)-.5)

void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    float d = 0.;
    //vec3 uv = vec3(fragCoord.xy / iResolution.xy,iTime*.2);
    vec3 q = vec3(fragCoord.xy/iResolution.yy-13., iTime*.2);
    mat3 m = mat3(-2,-1,2, 3,-2,1, -1,1,3);
    vec3 col = vec3(pow(min(min(f,f),f), 7.)*40.);
    fragColor = vec4(clamp(col + vec3(0., 0.35, 0.5), 0.0, 1.0), 1.0);
}
In order to use it in the Shader Editor android application you need to make these changes:
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif

uniform vec2 resolution;
uniform float time;
uniform vec4 mouse;
uniform vec4 date;

#define f length(fract(q*=m*=.6+.01*d++)-.5)

void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
  float d = 0.91;
  vec3 q = vec3(fragCoord.xy/resolution.yy-13., time*.2);
  mat3 m = mat3(-2,-3,6, 3,-1,1, 0,3,1);
  vec3 col = vec3(pow(min(min(f,f),f), 7.)*40.);
  fragColor = vec4(clamp(col + vec3(0., 0.35, 0.5), 0.0, 1.0), 1.0);
}

void main() {
vec4 fragment_color;
mainImage(fragment_color, gl_FragCoord.xy);
gl_FragColor = fragment_color;
}
You can see these changes are n the first part of the source code and just one on time.
You can play with this source code then use the option Set as wallpaper to have it on your phone.

duminică, 6 noiembrie 2022

News : Theatre.js helps three.js development.

Theatre.js is an open-source and hackable motion design library with a visual interface. It helps you animate THREE.js scenes, SVG trees, or even choreograph light shows.

vineri, 4 noiembrie 2022

Apple software : CozyBlanket.

CozyBlanket is a retopology app for the iPad designed as an accessible and relaxing experience. Its minimalist UI packs a fully featured mesh editor that can be used by directly drawing on the high poly mesh. CozyBlanket focuses on presenting retopology as an enjoyable, game-like process similar to solving a puzzle.
You can fins this application from the official website.

joi, 3 noiembrie 2022

marți, 1 noiembrie 2022

Shader Editor - example 002.

This post is just one simple example, you can find many tutorials if you search on web for my work ...
If you don't have enough time to test my last shader source code then you can test now with another source code to have a beautiful blue effect.
Let's see the source code for this shader:
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif

uniform vec2 resolution;
uniform float time;
uniform vec4 mouse;
uniform vec4 date;

//#define time  iTime
#define R resolution.xy
void mainImage( out vec4 fragC, in vec2 fC)
{

//   vec2 pos = (fragCoord.xy/R.xy) * 8. - 4.;
   vec2 pos = (fC.xy/R.xy) * 8. - 4.;
    pos.x *= R.x / R.y;
    float s = .25, f = .0, k = f;
    vec3 p = vec3(pos, sin(time * .4) * .5 - .5)* s;

    for( int i=0; i< 9; i++ )
    {
           p = abs(p)/dot(p,p)- 1.5;
           k = length(p) ;
           p = p*k+k;
   }

   f = dot(p,p)* s;
   fragC= vec4(f*.5, f *1.2, f * 5., 0.111);;
}

void main() {
vec4 fragment_color;
mainImage(fragment_color, gl_FragCoord.xy);
gl_FragColor = fragment_color;
}