shader development path

MrPixel

21-09-2010 02:16:53

I'm thrashing a bit on the best approach for shader development in Ogre. I'm a programmer and I would like to be able to author shaders (preferably as cg/cgfx) and have our artists use those shaders in Max and preview the effects in the oFusion viewport.

The (temporary) approach I've been using so far is to create the first pass of the shader in FX Composer as cgfx, then painstakingly convert it to cg/material for Ogre. Once it's in Ogre, I tweak it until it works correctly in Ogre. I think I read that Max will load material as cgfx - but I haven't tried it yet.

I just started looking into ShaderFX and it seems like there is a path to convert from cgfx to oFusion. But what I'm not clear about is if there is a way to dynamically modify shader code within ShaderFX.

Any guidance/advice would be greatly appreciated. BTW, we are using oFusion Pro.

Thanks,
-Pixel

Lioric

22-09-2010 01:44:26

ShaderFX can't load a shader code and convert it to node based schematic, it works the other way, you need to create the node based schematic and from there it converts to shader code

What you can do is to insert manually edited code with the "custom code node" (or a similar name) where you can hard code parts of the resulting shader code

Probably it will be easier and more productive to produce the shader in ShaderFX (see some tutorials) and after that you can hand optimize the produced shader code and continue using it in oFusion

Assign the ShaderFX material to any object as usual, and when you are ready to manually optimize it, just upgrade the object material to oFusion Material, this will create a source code shader that will be available in the shader list of the oFusion Pass (even after you restart max or open another scene), and can be used as needed, the shader source code will be produced in the \userName\Local Settings\Application Data\Autodesk\3dsmax\version\enu\oFusion\shaders folder where you can open it and edit as needed

MrPixel

22-09-2010 03:01:13

Thanks Lioric. Not exactly what I was hoping to hear - but I appreciate the info. It sounds like ShaderFX is the way to go with oFusion. I will look into the "custom code node" to see if that will work for us. Otherwise, I need to reimplement a bunch of shaders with ShaderFX schematics. :cry: