PDA

View Full Version : Custom Shaders (.usf)



Allar
11-15-2009, 12:14 AM
Is it possible for us to write and use our own shaders like the ones used in the Engines\Shaders directory?

I would like to write a shader that will be applied to all the current objects in the scene. I've experimented with PostProcessEffects using a MaterialEffect, but MaterialEffects only apply to the current scene texture apparently. Can I access object vertices and such through a materialeffect?

I have tried experimenting with the .usf shaders and tried creating my own, but I'm not even sure if its compiling or even how to apply a .usf shader.

It appears that when you create a material, you are actually creating a .usf shader based on MaterialTemplate as the HLSL code is visible, so I know we have some functionality there...

Basically, all I need is a way to create a material that will be applied to all rendered objects; either through unrealed or through an hlsl shader.

Is this possible/does anyone have any information regarding this? I would be very appreciative.

Denny
11-15-2009, 05:07 AM
I don't know if it's enough for you but there's a HLSL node in the material editor called Custom, see if it's something you can use.

Demruth
11-15-2009, 08:59 AM
That's a pretty cool new material node right there!

Allar
11-15-2009, 05:14 PM
How can you control the output of the custom node through the custom hlsl code?

I've tried all sorts of things 0.o