Day 17: Basic noise

Categories AShaderEveryDay

        Today I decided to set aside the ray marching engine to focus on GLSL’s basic like procedural  texture generation witch will be very unseful for the sphere tracing later 🙂 . To make this noise the formula is simple ;  you compute the sinus (sin(x)) of a dot of two 2D vectors , then you took the fractional part (fract(x)in GLSL) of the result. To resume is look like this :

float random (vec2 st) {
    return fract(sin(dot(st.xy,vec2(13.4,74.0)))*(83983.0));

First noise… 🙂

No Comments

Leave a Reply