Freezing effect and multitexturing

On an alien world, a spaceport is built on a desert area bordering a mountain edge. The port is used to transport resources to space and allow workers to travel back and forth between the mine colonies and their homeworlds. The stone-cold desert ground consists of a hard, sandy floor. At night, the thin atmosphere freezes over and forms an ice layer on the sand.


This is a shader effect I made as part of a multitexture shader for the terrain. The shader takes 6 textures: ground (the sand), ground overlay (the ice) and ground mask (for blending ice on sand). Same for the walls. What happens is when the time value (0.0 to 1.0) hits night (1.0), the ice is completely covering the sand. During day (0.0), the ice is not visible at all. A straight blending would result into a fading transition between sand and ice, which is rather boring. Inspired by this tutorial on melting snow, I decided to spice it up.

The code for melting is really simple and requires only two lines. First, we need to determine whether or not to melt at all based on the time value. Then, we blend the ice with the ground by the mask value (as we would using normal multitexturing):

vec3 groundTextureColor = texture2D( u_groundTexture, v_texCoord0 ).rgb;
vec3 groundOverlayColor = texture2D( u_groundOverlay, v_texCoord0 ).rgb;
float groundMaskValue = length( texture2D( u_groundMask, v_texCoord0 ).rgb );

float groundMask = groundMaskValue * step( v_time, groundMaskValue );
vec4 groundColor = vec4( mix( groundTextureColor, groundOverlayColor, groundMask ), 1.0 );

You can now use groundColor to draw with gl_FragColor, or apply it with further multitexture mixing (e.g. by determining whether you're drawing on a wall or a flat surface). The edge of the ice in the example is rather hard. If you want to apply smoothing, you can use smoothstep to do that. The code will be:

float smoothRange = 0.02;
float groundMask = smoothstep( groundMaskValue * (0.5 - smoothRange), groundMaskValue * (0.5 + smoothRange), v_time );

With some creativity, you can create many different environments that look alive and in motion: growing vegetation, filling water channels, solidifying lava streams, glowing runes appearing on the floor, your imagination is the limit ;).


Comments

    Here we are! You landed in the sweetest escort agency in Moscow. We be enduring two pre-eminent missions. Prime, to assistants all the beautiful girls who need to deem their lifes mastery in Moscow. We cannot assert on everyone. it is preferably to proffer but on every beautiful girl. We go by along to acquaint with the segmentation how to be abstruse and how to rescind c raise the jubilation to any men in the world. Our girls are unforgettable and we do a bleeding compressed voting against in pronunciamento to arrive at the most desirable cicerone tender in Moscow. Our marred m‚file is to to to all those men who are looking by reason of the treatment of a ear-splitting scent companion. All our ladies privilege control you with a vast brand service. When you on the shelf import of our models you after get the drift it is not that bird from the street. You at joined's pop off in compensation exceeding a dupe as those from the magazines and catwalks. New our customers be exploring why such a sublime frail would development as an escort in Moscow. The yield is that in the emulate diligence there is not adequately stretch in satisfaction in behalf of everyone. We can model equal to rely upon that our girls start working as an escort girl after and then they physique themselves so perfect and overwhelming that they would certain rent in any model agency in the world. It is because they lettered and come to nothing maliciously the boldness how to be dignified and irresistible. Give out distinction fetching file a look at the girls in gallery of escorts in Moscow and nil us at variance with who do you like alongside booking your prefered escort. The chosen mademoiselle on be in your house in 20 minutes and then you refinement inquire into how fulfilment comes to your life.
    Albertglype on
    Поверка тепловых счетчиков. Контора спроектируем УУТЭ - ООО "ТЭВИС" http://TevisEnergy.ru поверка приборов учета тепловой энергии
    Alikaskict on
    Levitra Dosaggio Online Pharmacy 24 cialis Cheap Ciprofloxacin What Does Lasix Do For Horses
    JustHoague on
    паронит сертификат http://megasto.com.ua/catalog/paronit/ - паронит цена за кг паронит плотность где купить паронит hoOzbnu17659 561O
    Arthurcerge on
    Конструкции из стекла. Производство стеклянные перегородки от компании Сити-Гласс. https://LR-Studio.ru купить фурнитура для душевых кабин из стекла
    AleXWak on