Problem with vertex colors

r33ko

17-04-2008 16:39:51

Hi everyone,

I recently made a test scene using the VertexTextureBlend_LM shader. Everything displays correctly in the oFusion viewport but when I load it into an Ogre App it colors my mesh with my RGB vertex color values, on top on my textures.

Any Ideas what can be causing this?

Lioric

17-04-2008 17:39:39

What Ogre engine are you using?

See the ogre.log in your application, it might contain more details on why the materials is not correctly loaded or rendered in your scene

r33ko

17-04-2008 18:00:38

1.4.7 is the version I am using.

I'll check the log and if I cant find anything, I'll post it here.

Thanks Lioric.

r33ko

17-04-2008 18:53:36

Here is the log file.

http://www.mediafire.com/?a2dd0m4mf1b

Im not good at finding problems in them. I know however that you can ignore the glass_vs shader error, as I dont plan to use it. But the mesh is Ground.mesh and the material is called Ground. If you could take a look that would be greatl appreciated.

Thank you,

r33ko

r33ko

21-04-2008 14:23:01

I still can't find a solution to this problem. If anyone has experienced similar issues or knows what the problem could be, I'd really appreciate it.

Thanks

Lioric

21-04-2008 16:42:24

Have you tested with OpenGL and D3D9 render systems?

From your screenshot it seems the model is being rendered in multiple passes, and the second pass is a non lighting fixed function pass

This can be because the render system used doesnt supports the material on your hardware (or drivers)

syedhs

22-04-2008 01:48:30

I had the same problem, and as soon as I disable all lighting + directional light, the problem dissappeared. So you end with no shadow too :wink:

r33ko

24-04-2008 18:45:50

Have you tested with OpenGL and D3D9 render systems?

aye :? . In fact OpenGL is worse. and It is a single pass material with 4 texture units for RGBA values of the mesh vertex colors.

I had the same problem, and as soon as I disable all lighting + directional light, the problem dissappeared. So you end with no shadow too

I tried this and I didnt quite get good results. I'll explain.

I did a few tests.

1. I managed to load a vertextextureblend shader in a scene with no other objects and just 1 directional light (no shadows). It works.

2. Same as above with only 1 sphere added above to cast shadows onto the ground (VP shader applied to ground). Texture modulative with no self shadowing. it works, BUT there are no shadows being cast (all settings are ok, cast/receive shadows, etc.). I find this very strange.

3. My original scene, with 4 spheres using realtime reflection, env.map reflection, masked env.map reflection, normal mapping and specular. A billboard set for the sun and a type skybox with a cubic *.png texture. 1 directional light with shadows enabled (texture modulative, uniform_focused). does not work. I see shadows being cast onto the ground from the spheres, but my vertex colors are all messed up and display above my textures. (just like in my first image).

I don't see what the problem could be :roll: . Ill keep digging around, if anyone has any suggestions please let me know. :)

Evak

24-04-2008 19:24:59

what kind of shadows are you using? I seem to recall additive stencil shadows acting strangely with a similar shader I made a while back. Only modulative stencils worked because there are extra steps required to get additive ones to behave nice with shader materials.

r33ko

24-04-2008 19:27:30

Actually, I don't use stencil shadows at all. all my shadows are texture based. More precisely, Modulative Texture shadows, generally 512 or 1024 resolution.

Lioric

25-04-2008 15:55:51

You need to customize your materials when working with shadows, specially you need to add a first ambient only pass

Test by adding an ambient base pass (first pass, then the texture blend pass), use it with the "AmbientOnly" shader and set all pass material colors (diffuse, ambient, specular) to white

r33ko

25-04-2008 19:16:17

Alright cool. So I tried what you said, I added a base_pass before the blend pass with AmbientOneTexture shader. I also had to set the depth bias to 1 (less_equal) on my blend pass since I had alot of Z fighting.

Good news! no more vertex colors jumping around everywhere. The shader respects all the coordinates for RGBA that i assigned and it displays correctly.

The only thing now is a shadow problem.

I got 2 results:

1. Scene with Texture Modulative shadows = there are no shadows apparent, except when I zoom in very very close I see a shadow but once again the red from my vertex colors pops up over the texture.

2. Scene with Stencil Modulative shadows = works great. shadow is displayed and in the right place. no texture bleeding or unwanted effects.

(but I still prefer Texture based shadows :P )

Do you know of anything that could be preventing me from using Texture Modulative shadows?

ogredennis

17-08-2009 04:09:36

i get the same probelm!!
have any resolution?
i use the ambientonetexture pass first
but did not have any shadow.
i guess the error occur in shadowmap step
because when i use some material
=====================
material plane
{
}
======================
i get the result like image show

have any resolution?