| All posts |
The most powerful node in Plane9 has seen the light of daypublished on 1/27/2010 9:49 PMNot too long ago I started to understand just how powerful and simple shaders are. I have for the most part though that, yes they can do specular bump mapping and things like that. I have also known about raytracing experiments on the gpu and physics simulations but all of them seemed overly complicated and for the most part very slow. But after seeing what they managed to put in 1024 byte intros my interest really sparked.
So after some work I have now added the single most powerful and versatile node in Plane9. The shader node. Learn to know it since its going to be your best friend.
It managed to recived the nice status because it allows you to add a cgfx shader as an effect. The effect can be changed and will update the scene in realtime. To help in utilizing the shader as much as possible a number of texture, color and vector inputs exists. But that my friend is not all. No to make this even better an expression port has been added.
Using this you can take in data, for example "In1.x", feed it though the expression parser than can use or create a new value like "in2.x=sin(in1.x*time)". That value in turn will then be sent of to the shader as global variables. This means that you can precompute a lot of heavy operations in the expression parser and thus simplify the shader code. This can create some significant performance boosts since computing a value once per frame or once per pixel on the screen is a big difference.
Last but not least to make it a bit easier to work with the shader code is color coded. The expression parser has also received some nice shiny colors.
The shader in this screenshot comes from 'To The Road Of Ribbon' by FRequency. Its stunning what can be done in 60 lines of shader code and this is of course only the very top of the iceberg of things that can be done.
Seeing the shader on multiple monitors is a sight of joy if I may say so myself.
Since each scene is created for one specific purpose I will most likely put my lighting node on the shelf. The way it would work is that you can attach a light node, say a point light, to a transform node. That light would then be sent in to the shader that was used for a specific object. However since these shaders now will hopefully be specific for each and every scene the point of having a generic lighting systems has decreased quite a lot.
It still have it use since if you have 100 objects and 100 lights the shader would get the light closest to that specific object its currently rending but I'll rather add this feature later down the road then delay the release. Yes, I do have one plan in the not too distant future.
Now lets just hope Mass Effect 2 is really, really boring ;)