Melting Snow Shader approach

Posted By: Joozey

Melting Snow Shader approach - 01/27/13 13:32

http://joostdevblog.blogspot.nl/2012/12/dynamically-melting-snow.html

This article describes how to create a melting snow effect in shader model 2.0. Perhaps you can go creative with it laugh.
For the record: I did not write this article, credits go to Joost, developer at Ronimo Games.
Posted By: Uhrwerk

Re: Melting Snow Shader approach - 01/27/13 15:08

Cool! Did you do this for a sepcific game?
Posted By: sivan

Re: Melting Snow Shader approach - 01/27/13 15:20

nice idea
Posted By: Joozey

Re: Melting Snow Shader approach - 01/27/13 21:57

I haven't tried it myself, but it was a good read. Something worthy to put in the bookmarks laugh.
Posted By: ratchet

Re: Melting Snow Shader approach - 02/01/13 11:10

Here is a better utilisation of that sort of shader :
Some sort of multitexture painting in the 3D models directly, so you can have lot of variety and non repetition on textures.

Transisiton shader
Posted By: mk_1

Re: Melting Snow Shader approach - 02/01/13 11:33

A little explanation. This is pretty easy to do.
Posted By: Superku

Re: Melting Snow Shader approach - 02/01/13 13:50

This may be a stupid question but I don't understand the concept behind vertex colors:

Quote:
What is vertex painting? Essentially it’s blending several textures depending on the mesh’s vertex colors. Since vertex colors are linearly interpolated you get a smooth result.

I know that if I have a color vector in the vertex shader and push it to the pixel shader the values get interpolated, but where does the vertex color come from? Is it a regular tex2D operation in the vertex shader? If yes/ no, is it possible in acknex?
Posted By: mk_1

Re: Melting Snow Shader approach - 02/01/13 13:58

Vertex colors are part of the mesh. You create them with a modelling tool. I'm not sure if MED can do this, but I expect that mdl supports vertex colors. An example of how to use a vertex color:

http://stackoverflow.com/questions/11856547/getting-the-color-of-a-vertex-in-hlsl

This should get you started. I haven't done anything in hlsl since I departed from 3dgs, but it should be fairly simple.
Posted By: MasterQ32

Re: Melting Snow Shader approach - 02/01/13 13:58

the vertex color is just a value stored in a vertex declaration (just like POSITION, TEXCOORD0, NORMAL, ...)
But afaik gamestudio doesn't support vertex colors natively but you could use other vertex data for this (like second UV set or the first one and use triplanar texture mapping or similars)
Posted By: MasterQ32

Re: Melting Snow Shader approach - 02/01/13 14:03

Code:
#define D3DFVF_D3DVERTEX (D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX3|D3DFVF_TEXCOORDSIZE2(0)|D3DFVF_TEXCOORDSIZE2(1)|D3DFVF_TEXCOORDSIZE4(2))


Gamestudio does not support vertex colors but 3 texture coords
Posted By: sivan

Re: Melting Snow Shader approach - 02/01/13 14:21

I don't know how to use 2nd and 3rd texture set... but if I guess well it could be used for storing a lighmap?
Posted By: Superku

Re: Melting Snow Shader approach - 02/01/13 14:29

Thank you both for the explanation and idea!
Using the 3rd coordinate set (a float4 vector) works fine!
© 2024 lite-C Forums