Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define DENSITY 16.0
- #define OPACITY 0.6
- #define GRASSCOLOR vec3(.325, 0.6, 0.1)
- #define WALLCOLOR vec3(0.477, 0.316, 0.164)
- #define ROADCOLOR vec3(.133, 0.125, 0.125)
- #define YELLOW vec3(0.7,0.6,0.2)
- float getnoise(vec2 uv, float density) {
- vec2 noiseUV = floor(uv.xy * density) / density;
- return fract(sin(dot(noiseUV, vec2(43928.2908985, 23234.393201))) * 3215.241466);
- }
- void mainImage( out vec4 fragColor, in vec2 fragCoord ) {
- vec2 uv = fragCoord/iResolution.xy;
- vec3 diffuse = vec3(0.0);
- if (uv.x < 0.5) {
- if (uv.y < 0.5) {
- diffuse = ROADCOLOR;
- }
- else {
- diffuse = YELLOW;
- }
- }
- else {
- if (uv.y < 0.5) {
- diffuse = GRASSCOLOR;
- }
- else {
- diffuse = WALLCOLOR;
- }
- }
- float n = getnoise(uv, DENSITY);
- vec3 outcol = diffuse + diffuse * n * OPACITY;
- fragColor = vec4(outcol,1.0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement