Slope shader : Real-Time Meteorological Effects for Envirronement

This is fantastic! Here’s me after a few minutes fiddling around. The possible applications for this are huge! Terrain is what I am mainly interested in though.

This realy pushs the bge.
I’ve also created a little demo.







Download Demo

Hi !

(oops didn’t see your post Brunfunstudios, that’s really cool, love it !)

Nice one WizzleDonker, I didn’t much imagin the slope shader on (very) large objec but your result is quite impressive !

If I may, I think that in your case, you can use the global vector output of the geometry; normalize it and you’ll have (with few values tweaking) a nice gradient along the Z axis. You can use this gradient as masks to show textures only at a certain height;). I also suggest to take a look at the .blend that I shared; it use a cavity map to blend the texture at the transitions of the slope with a more interesting shape ! Here is an old attempt where I blend the snow with a cavity map (I didn’t use the slope but a black and white hand-painted mask) :


the snow tends to don’t melt when it is on the cavity of the rock.


Diffuse rock (the diffuse snow is deviated from this one), cavity map (reversed, sorry for that) and sparkles were the only texture I use for the ground.

So here is where I’m with the wet stone :eyebrowlift: :

http://i.imgur.com/Hgt9F7H.gif
with some rock and water materials

I finally achieve to have a decent mapping of the water : I re-use the same technique than you, Ace Dragon (nice shader by the way), but with 3 vectors (0°,120°,240°) instead of two to avoid the stretching.

http://i.imgur.com/9m1YBbx.gif
there are still odd lines but it’s not very noticeable on the final shader with low scale (did it?).

The rain will fall wathever the rotation of the object AND will preserve his own scale ( I didn’t pay attention on that when I was making the shader but that surely was a nice surprise!) :

I now have the animation of the shader in the viewport but I’ve used the most odd trick that you can possibly imagine (an animated texture with a B&W gradient :eek: !) so if you have a better (that’s won’t be hard) solution, please tell me !

Rubbernuke : Yes, that’s the idea I’ll follow for the water that don’t move. But I maybe make my self unclear so I drew what’s the remaining problem for the splashes :

I could use a painted mask for that but my goal on those shaders is to use them on every objects wathever its size, rotation, shape with less possible adjustments (personnal mask, UV mapping,etc…). This goal is for two main reasons : it will standardize the meteorogical effect on all the objects on the scene and it will make the work easier for level-design. But on that case, I think that’s not yet possible to do that procedural mask so I probably will make a painted mask.

I’m not quite sure I understood your question BluePrintRandom, do you mean like lava? The rain and rock can be standart materials so you can change emission parameter inside the material editor of the propreties. In fact, on the gifs with no lights, the white is the B&W mask I use to add rain.

Hope to see more of your work and attempt with the slope effect or lamp data !

On this, this is possible through the use of another output in the Lamp data node.


1). Make sure that shadows are enabled for the lamp being used as the reference, as otherwise you will not get any masking (though the lamp energy value can still be set to 0).

2). I used the normal data trick to omit the masking for perfectly vertical surfaces, as there are flickering issues when the faces are in perfect alignment with the face direction.

Amazing! I can’t wait for applied it for my game. I found the water fall effect very useful for rainy places.

This is effect is very handy, however is there anyway to make the effect fade in and out? (based on the lamps energy).
so that when the lamp energy (animatable value) is at 0, only one texture shows, and when set to 1, the snow texture shows strongly like in all the previews.

Thanks

Thatimster : I don’t know any Energy Input in the node editor but you can totally use the Color input of the Lamp node then multiply it with the slope mask. If the color is black (value=0)it will disable the slope effect (slopemask*0=0), if it’s white, it will be fully enable. Color value can be animated too !

LFDA Studio : cool ! Could you post some pictures?

Thank you for the clear explanations and the trick Ace Dragon, I took a break from the rain shader but here’s the last version with drops on top (simple animated texture with procedural mapping from Geometry-global Input) :
http://i.imgur.com/PcQiI6i.gif

psychedelic drops mask :

http://i.imgur.com/tTDh3Ji.gif

I tried to do something subtle to not have a sharp and hard mask like that :

For the really brave, I upload my current file but the shader is really complex and I didn’t make any explanations :evilgrin::https://www.dropbox.com/s/8iafda6wxf038fw/Rain.rar

PS : OK, there was issues with the packing, the textures should be working now !

Attachments


I thought exactly in this effect, and in the Ace dragon’s effect, but i can’t share screenshots because i’m in an eraly development state.

Would you mind packing the textures? The node system seems a little uncooperative (and glitchy) for me when I replace the texture.

interesting topic here :slight_smile:

Really interesting thread. Based on the stuff here Ive done this in cycles although rather than use a lamp node ( which doesnt seem to exist in cycles) i simly used a normal node. Essentially the same technique and gives a very straightforward way of slope texturing.

The issue with using the normal data provided by the nodes is that every piece of coordinate data provided by them change depending on the camera angle. This is the same issue as seen when using the old Internal Render engine and the solution is the same, which is to use light data.

Ace - I understand the point you are making. However thats not quite what Im doing. ( My apologies for not being clearer) Im taking the geometry normal and then dot producting this with a set normal vector. ( in this respect this normal vector is I think taking the place of the vector that the lamp woudl be providing) Im then feeding a gradient mapping setup using that dot product. ( ie to colour ramp then splitting RGB components etc) It seems a very easy way to map based on slope.

This is exactly what I want to do, but I’m not getting my textures to show up in game mode. Could you please post a .blend? Thanks!

Nice! This is exactly what I want to achieve. Could you possibly posta .blend? Thanks.