Not the same result between Ofusion and Ogre

roux

19-08-2009 08:45:57

Hi everybody,

I'm new in Ofusion and Ogre and I meet many difficulties to export materials correctly to Ogre.
I use 3D studio Max 2009 and ofusion pro 1.973 to made an virtual aquarium. I must creat all the graphique part for this project and I search how can I use bump map with diffuse with alpha map.

The problem is Nowely I have a different result in Ofusion and FlowED. I have use the tutorial 5 of Ofusiontechnologies (http://www.ofusiontechnologies.com/tutorial5_part1.html) to creat a shader who can use correctly normal bump. After I have create a new pass with alpha mask


fragment_program tutorial_BumpMap_ps cg
{
source tutorial_BumpMap_ps.source
uses_adjacency_information false
entry_point main
profiles ps_2_0 arbfp1 fp20

default_params
{
param_named Ka float4 0.3 0 0 0
param_named Kd float4 1 0 0 0
param_named Ks float4 1 0 0 0
param_named_auto ambient ambient_light_colour
param_named bumpiness float4 1 0 0 0
param_named_auto diffuse light_diffuse_colour 0
param_named_auto specular light_specular_colour 0
param_named specular_power float4 64 0 0 0
}
}

vertex_program tutorial_BumpMap_vs cg
{
source tutorial_BumpMap_vs.source
uses_adjacency_information false
entry_point main
profiles vs_2_0 arbvp1

default_params
{
param_named_auto eye_position camera_position_object_space
param_named_auto inv_view_matrix inverse_worldview_matrix
param_named_auto light_position light_position_object_space 0
param_named_auto view_proj_matrix worldviewproj_matrix
}
}

material tuto_shader
{
transparency_casts_shadows on
technique
{
pass
{
lighting off
scene_blend add
alpha_rejection greater 105
cull_hardware none
cull_software none

texture_unit
{
texture_alias alpha
texture scorpaenaScrofa_alphaWhite.png
tex_address_mode mirror
filtering linear linear linear
colour_op_ex source1 src_texture src_current
colour_op_multipass_fallback dest_colour zero
alpha_op_ex blend_diffuse_alpha src_texture src_current
}
}

pass
{
iteration once_per_light
ambient 0.7 0.7 0.7 1
diffuse 0.7 0.7 0.7 1
specular 0.9 0.9 0.9 1 25
alpha_rejection greater 156
depth_func equal
cull_hardware none
cull_software none

vertex_program_ref tutorial_BumpMap_vs
{
}

fragment_program_ref tutorial_BumpMap_ps
{
param_named_auto specular light_specular_colour 1
}

texture_unit
{
texture_alias diffuse
texture scorpaenaScrofa_diff.png
colour_op_ex source1 src_texture src_current
colour_op_multipass_fallback dest_colour zero
alpha_op_ex blend_diffuse_alpha src_texture src_current
}

texture_unit
{
texture_alias bump Map
texture scorpaenaScrofa_nmap.png
colour_op_ex source1 src_texture src_current
colour_op_multipass_fallback dest_colour zero
alpha_op_ex source1 src_texture src_current
}
}

}

}


In ofusion everything rull and make me a good result :



But when I execute it in FlowED or Ogre, the result is very different :



May be it's a big foolishness to my part because I'm a graphiste (so it's very difficult to me to enter in code conception), but if somebody know what wrong here or understand my problem I thank him to put me of my hole.

Major

19-08-2009 22:36:31

It looks to me like it could be the result of having one pass using Fixed Function Pipeline (no shaders) and the other using Shaders.

Try using a shader in your first pass, or integrating whatever you're trying to acheive with both passes into one single pass using a shader.

roux

20-08-2009 08:43:19

Thanks major, You put me in the good way, Alpha shader work succesfuly

But it's not finish yet, I search now why the bump shader work on Ofusion and don't work on Ogre.

If I find I'll put my technique in this topic.

Lioric

24-08-2009 16:07:57

See your ogre.log file it might provide you with hints on why the shader is not working (it might be that is was not loaded, or that the render system used dont support it)