aboutsummaryrefslogtreecommitdiff
path: root/games/minimal/mods/default/textures
Commit message (Expand)AuthorAge
* Minimal: Add river water nodes (#5809)Paramat2017-05-24
* Add 2D sheet animation for nodessfan52017-01-02
* Added "[sheet" to the texture special commands.Luke Puchner-Hardman2017-01-02
* Minimal: Remove recently added unnecessary nodesparamat2015-07-14
* Minimal: Add snow biome and jungleleaves nodes. Add mapgen aliasesparamat2015-06-12
* Add drowningPilzAdam2013-06-19
* Compress texturesDavid Gumberg2013-06-18
* Swap out pixel-perfect nyan cat by request of Chris TorresPerttu Ahola2012-11-09
* Revert back proper crack texturePerttu Ahola2012-06-16
* Allow node cracking animations of any lengthPerttu Ahola2012-06-16
* Node texture animationPerttu Ahola2012-06-16
* Add fire visualization to minimal furnace menuPerttu Ahola2012-06-03
* Lua implementation of furnace with visible active statedarkrose2012-06-03
* Move games/minetest to games/minimal and update README.txtPerttu Ahola2012-03-26
loat get_rgb_height(vec2 uv) { if (texSeamless) { return intensity(texture2D(baseTexture, uv).rgb); } else { return intensity(texture2D(baseTexture, clamp(uv, 0.0, 0.999)).rgb); } } vec4 get_normal_map(vec2 uv) { vec4 bump = texture2D(normalTexture, uv).rgba; bump.xyz = normalize(bump.xyz * 2.0 - 1.0); return bump; } void main(void) { vec3 color; vec4 bump; vec2 uv = gl_TexCoord[0].st; bool use_normalmap = false; get_texture_flags(); #if USE_NORMALMAPS == 1 if (normalTexturePresent) { bump = get_normal_map(uv); use_normalmap = true; } #endif if (GENERATE_NORMALMAPS == 1 && normalTexturePresent == false) { float tl = get_rgb_height(vec2(uv.x - SAMPLE_STEP, uv.y + SAMPLE_STEP)); float t = get_rgb_height(vec2(uv.x - SAMPLE_STEP, uv.y - SAMPLE_STEP)); float tr = get_rgb_height(vec2(uv.x + SAMPLE_STEP, uv.y + SAMPLE_STEP)); float r = get_rgb_height(vec2(uv.x + SAMPLE_STEP, uv.y)); float br = get_rgb_height(vec2(uv.x + SAMPLE_STEP, uv.y - SAMPLE_STEP)); float b = get_rgb_height(vec2(uv.x, uv.y - SAMPLE_STEP)); float bl = get_rgb_height(vec2(uv.x -SAMPLE_STEP, uv.y - SAMPLE_STEP)); float l = get_rgb_height(vec2(uv.x - SAMPLE_STEP, uv.y)); float dX = (tr + 2.0 * r + br) - (tl + 2.0 * l + bl); float dY = (bl + 2.0 * b + br) - (tl + 2.0 * t + tr); bump = vec4(normalize(vec3 (dX, dY, NORMALMAPS_STRENGTH)), 1.0); use_normalmap = true; } vec4 base = texture2D(baseTexture, uv).rgba; #ifdef ENABLE_BUMPMAPPING if (use_normalmap) { vec3 L = normalize(lightVec); vec3 E = normalize(eyeVec); float specular = pow(clamp(dot(reflect(L, bump.xyz), E), 0.0, 1.0), 1.0); float diffuse = dot(-E,bump.xyz); color = (diffuse + 0.1 * specular) * base.rgb; } else { color = base.rgb; } #else color = base.rgb; #endif vec4 col = vec4(color.rgb, base.a); col *= gl_Color; if (fogDistance != 0.0) { float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); col = mix(col, skyBgColor, d); } gl_FragColor = vec4(col.rgb, base.a); }