struggling with shader examples

mkh42

28-08-2006 18:46:13

Hello
after the ocean demo seems not to work i want to try other demos which uses shader. i tried the monkey export demo but was not successful. i recognize that nearly all shaders in the ofusion/media/shader directory seems not to function. If i activate one of the shaders and press edit there are no parameters at all. the only shaders which seems to worke are the followings:
Examples/BumpMapVPSpecular
Ogre/BasicVertexPrograms/AmbientOneTexture
Examples/BumpMapFPSpecular

This three shaders seems to behave correct but i was not able to locate them in the media shader directory. all other shaders which i can easily locate in the media/shader directory as .program and .source files seems not to work correctly .

Do i miss something fundamental or is there something broken in the new version. because i start with ofusion i do not have an older version to compare the behaviour.

my system:
3dmax 8
newest nvida driver
geforce 6800
windows xp

There are no errors reported in orgre.log concerning parsing the shader files.
I tried all the things with opengl and also with directx activated in the ogre viewport.

greetings
mkh42

mkh42

29-08-2006 17:26:10

Hello
does nobody has a hint for me?

does anybody with the new ce version successfully export render monkey shaders following the tutorial ?
If yes what 3dmax version, graphic card etc.


Do you need more infos to my problem to give me a hint?

For me the main reason using ofusion are shaders and multitexture so it would be nice to get it to work.

Greetings
mkh42

Lioric

30-08-2006 03:43:51

The issue is that some shaders seems to be using the layout of a previous Ogre engine version (the constant parameters declaration in the shader files)

If you change the shader constant parameters to be declared inside the function it should work

I will review this and update the files and the tutorial as soon as i get some free time

mkh42

30-08-2006 17:54:05

Hello

thank you for you hint.
i moved the constant declaration in the function parameter declaration like in the example for an pixel shader below and it works.

Greetings
mkh42

modified example from tutorial to export shaders from render monkey. You can follow this example but you have to place the constant declarations in the functions input parameter declaration (look below). Make this for pixelshader and vertexshader and the tutorial works fine.
note: all the shaders in the ofusion installation media/shader folder with the extension .source seems to have the same problem and have to be modified. this is also the reason that the two examples from http://www.ofusiontechnologies.com/scenes.html seems not to work correctly with the new version.

PS_OUTPUT_STRUCT main( PS_INPUT_STRUCT psInStruct,
uniform float4 specular: register(c2),
uniform float Ka: register(c3),
uniform float Kd: register(c4),
uniform float Ks: register(c5),
uniform float specular_power: register(c6),
uniform float bumpiness: register(c7),
uniform float4 ambient: register(c0),
uniform float4 diffuse: register(c1),
uniform sampler base_map: register(s0),
uniform sampler bump_map: register(s1)
)