rendermonkey to ofusion help plz

Mike_H

01-07-2006 19:53:40

Hi,

Im having trouble moving a shader made in rendermonkey to ofusion, all is well except in the final line of the ps :

return inDiff * (0.6*tex2D(Paint,inTex)+0.4*texCUBE(EnvMap,inReflect));

inDiff is the diffuse lighting which is then multiplied with the result of the combination of the base texture and the cube map.

This allworks and looks great in rendermonkey but when tried in ofusion all is well untill the envmap texture unit is added it then becomes quite dark, and it seems my only option then is to select a blend mode specified in the texture unit dialog...modulate is too dark and add is too bright....i would like to use the method in the shader to get the effect i want. is this possible?

I hope someone can help, i am quite new to shaders and ofusion so if ive missed something along the way i wont be surprised although i have looked through the tutorials and example files but none seem to answer my question. Also are render targets supported in this latest version?

Regards,

Mike.

Mike_H

02-07-2006 08:00:43

I have noticed that the ps doesnt seem to be working in ofusion which would be causing the problem, is there a reason for it not to be accepted? as it works in rendermonkey? i have read the tutorial for moving shaders from rendermonkey and it mentions using texcoord1 for binormal data but i hvae no binormal data in this shader and so i have used texcoord1 for the reflection coords. is this wrong? could this cause the shader to not load properly?

mike.

edit: my ps code....

sampler Base_Tex;
sampler EnvMap;

float4 ps_main(
float4 inDiff : COLOR,
float4 inTex : TEXCOORD0,
float3 inReflect: TEXCOORD1 ) : COLOR
{
return inDiff * (0.6*tex2D(Base_Tex,inTex)+0.4*texCUBE(EnvMap,inReflect));
}

Mike_H

02-07-2006 13:08:18

the pixel shader now works in ofusion after i unchecked and rechecked the second texture unit, the material appears much brighter and looks correct was this something to do with the renderstate? as each time i open the file in max i have to this to make it work. can i set my own renderstate for the material?

Mike.

Lioric

02-07-2006 19:02:19

You can use whatever TEXCOORD channel you want as long as the shader and the models are created to with this in mind

You can control the render state of of the material with all of the material settings, they are there for setting the render state

Do you mean that you have to re-click on the active check of the second texture unit every time to make it work? what is this second texture unit type?

It will be better if you can send me a test scene where this can be reproduced so i can take a look at it and fix it

Lioric

04-07-2006 17:14:02

I tested your scene today, it works correctly when loaded

Is this how it should be displayed? (i modifed the ground color a little)


click for bigger image

It was tested in a newer version that the available CE

But in the CE version you have, the issue can be reproduced, i.e. when loaded you need to re-click the texture unit to update the correct display

So this is fixed and will be available to you when the next update is posted

Mike_H

04-07-2006 23:25:38

Yes thats great :) and good news that the problem is fixed allready, no worries for me as such now since i am able to work around it. Thanks for looking into it, i look forward to the next release.

Cheers,

Mike.

adg

14-07-2006 21:17:34

Hi. How can I read this in oFusion?

float4 position : POSITION;
float2 texCoord : TEXCOORD0;
float4 tangent : TANGENT; //TEXCOORD1?
float4 binormal : BINORMAL; //TEXCOORD2?
float4 normal : NORMAL; //TEXCOORD3?

Lioric

14-07-2006 21:25:28

See the "Using Render Monkey Shaders" tutorial in the "Artist Center", there you will see the details of using TANGENT and BINORMAL data