shaderFX -> oFusion -> Ogre and educational oFusion ed

Kim2

31-10-2008 14:35:38

Hi,

Could somebody please tell me how you use .fx shaders with oFusion? I'm trying out shaderFX but I don't know how to get the shaders into the actual game.

Also, I saw Lioric mention an educational edition of oFusion, is he actually talking about the CE or is there another, more fully featured version available for educational use?

Thanks a lot!

Kim2

31-10-2008 15:00:07

I saw a thread here
http://www.ogre3d.org/phpBB2addons/view ... ht=shaders

which had some flash tutorials but the links have expired. :(

After searching the forum a bit more it seems that the CE can't export the directx shaders?

Evak

31-10-2008 16:00:06

ShaderFX for ofusion doesn't create .fx files. What happens is that you assign shaderFX materials to objects in your scene just like any 3dsmax material. The shaderFX material appears in the max viewport and in the ofusion viewport. Exporting your scene the usualy way and ogre shaders are exported with your scene.

if you want an ofusion ogre shader material to tweak instead of a std max DX shader material you just use the eyedropper to pick your shaderFX material, create a ofusion material over that slot keeping the original material and press the evaluation button. Ofusion then creates all the ogre passes and texture units etc for you.

Works like a charm with the shaderFX std material type which I use most of all, advanced material type is supported too. So using shaderFX is all quite transparent, you don't really have to do anything to see and export ogre shaders.

The ofusion shaders are more optimized than the .FX ones shaderFX creates, supports ogres autoparams and has quite a few enhancements. Things like ShaderFX has no per light attenuation thanks to 3dsmax limitations with shaders, ofusion supports this just fine.

The extra effort by Lioric in getting more ogre focused versions of the shaders is much appreciated here :).

I would like to see if there's a way to get the render to texture feature in ofusion to work with shaderFX created materials. Thats one area that I havent been able to get any results on.

Kim2

31-10-2008 16:50:42

Evak thank you a lot for your speedy reply. I tried following your instructions

if you want an ofusion ogre shader material to tweak instead of a std max DX shader material you just use the eyedropper to pick your shaderFX material, create a ofusion material over that slot keeping the original material and press the evaluation button. Ofusion then creates all the ogre passes and texture units etc for you.

But the material doesn't show up in the oFusion viewport and when I try to export the scene it just exports a material file with a basic material (diffuse, ambient). Is it because I'm using the CE version? This is under 3d max 2008.

Evak

31-10-2008 18:09:07

I was talking about the Pro version. The CE edition is outdated by over a year now and is missing half the most usefull features of the pro version, and isn't 100% compatible with Ogre 1.4 since it targets Ogre 1.2 which was the current version a year ago.

Ofusion Pro is at 1.9x and is for Ogre 1.4, with a 1.8x version which like the CE edition is for Ogre 1.2.

Lioric has mentioned an educational version in the past. I'd assume that was the pro version. Hopefully there will be an updated CE edition soon, it's been a very long time and a lot of problems have been fixed since then.

Kim2

31-10-2008 20:07:35

Hopefully he'll shed some light on it. The shaderfx interface looks like an incredible tool for learning how to put shaders together.

I guess with the pro version it would be very easy to grab a bunch of shaders from say the nvidia shader library (http://developer.download.nvidia.com/sh ... aders.html) and get them into your game very quickly?

Evak

31-10-2008 22:20:47

Well if you understand what the shaders are doing maybe. but shaderFX requires you to build the shaders yourself in a flowchart kind of fashion. Where nodes have inputs and outputs and math operations.

So you couldn't really just load something from the NV shader library. ShaderFX doesn't import shaders only exports to .FX or saves to ogres format via ofusion. Best bet with nvidia shader library is something like FX composer and the ogre exporter someone is doing in the main forums.

Shaders just arent that simple, ShaderFX makes it easier with a nice visual interface and takes the coding aspect away. Plus the standard shaderFX material has a lot of shortcuts with helper nodes for bump, specular, illumination etc, that your wire into, but it's still quite complicated once you get past simple shaders like bump maps, blending with masks and vetex colours etx.

Luckily there are quite a lot of samples with shaderFX that help you figure out what you need.

imtrobin

01-11-2008 07:52:12

Our workflow with shaderfx -> Ofusion is not that fantastic. Bascially it will only work for things which do not require shadows since the custom shadow shader codeis cannot be done in shaderfx or previewed in 3dsmax.

Evak

01-11-2008 18:04:07

Yeah thats true, our coder has it so I just insert a couple of lines in a methodical way to get custom shadows working in our app. Ofusion only supports the standard basic shadows.

I keep hoping that Ogre will get more artist friendly softshadows and simpler deferred shading support. At the moment Ogre isn't so hot with interiors if you want full dynamic shadows and your using stencils. Can't really have pointlights in a room casting full shadows without building the interior walls as seperate meshes :(.

Still Shaderfx is great for describing local material surfaces on objects.

imtrobin

01-11-2008 18:21:04

I don't think it's an ogre limitation. It looks more like max viewport not supporting post effect shader. I sort of read Max 2008/9 has that feature but too bad we are not upgrading to that yet to confirm.

Evak

01-11-2008 22:17:30

ShaderFX doesn't do any global scene compositor/post effects, I believe that is one of the features that they were planning for ShaderFX 3. Will be interesting to see whether Ofusion can support this. Seems like it would be pretty difficult to do. Having said that, I thought shaderFX support would be very difficult to do properly too :)

Kim2

04-11-2008 03:00:43

I sent an email to the oFusion contact mail, hope they get back to me about it soon.

Kim2

04-11-2008 04:15:05

Hey Evak, while I'm waiting for Lioric to get back to me you wouldn't be able to share an ogre-ready glow shader with me would you? I really need a glow effect for a uni project I'm working on. The glow effect that comes with shaderfx would be fine if you could export it out for me.

Lioric

05-11-2008 03:10:25

As a note, you can use .fx files directly (as from the nVidia library) just use the DirectX material and all is automatically handled, as long as the shader dont uses RTT samplers as there is currently no way to map them to Ogre

Kim2

11-11-2008 17:04:27

Lioric, I bought oFusion but it seems that most shaders need RTT. Can you help me get a glow effect going please?

Lioric

13-11-2008 16:16:37

Yes, a new tutorial with RTT glow effect will be posted soon, hope in then next days

Evak

13-11-2008 16:58:55

hey cool, I never did figure out how to use RTT :)

Kim2

19-11-2008 02:21:35

Great, looking forward to it.