Block bump mapping with "create meshes" on (A7)

Posted By: CBSection31

Block bump mapping with "create meshes" on (A7) - 09/07/07 18:33

I have A7 Pro. I'm using the very basic bump map code on some blocks in my level. As expected, the level runs very slowly. That's the reason I had never used block-based materials in the past.

However, with A7's new create meshes feature (in the map compiler), I'm hoping that it will be possible. Of "create meshes", the manual states:

"Lets the engine render static meshes, rather than blocks. Recommended when more than 8 dynamic lights should be visible at the same time, or when shaders are applied to level surfaces f.i. with the d3d_automaterial function. In this mode the level rendering can be greatly sped up by combining block groups to single meshes."

This sounded like it might speed up the bump mapping, so I decided to give it a try. The good news is that it does speed up the level insanely...the bad news is that the bump map code doesn't look right now. As you can see below in the screenshot, it looks as if it somehow messes up the static light map calculations, although I could be wrong.

I'm hoping that one of you coding geniuses out there can help me out, as I know very little about shaders. Do you have any idea what could be causing the change? Is bump mapping just not possible in mesh mode?

For reference, here is the bump map code I am using, along with two pictures of my level:

Code:
		matrix matWorldViewProj; 
matrix matWorld;

texture mtlSkin1;
texture entSkin1;
texture entSkin2;
texture entSkin3;
vector vecLight;

technique dot3map
{
pass p0
{
Texture[0] = <mtlSkin1>;
Texture[1] = <entSkin2>;
Texture[2] = <entSkin1>;
Texture[3] = <entSkin3>;
TextureFactor = 0xFFFFFFFF;

COLOROP[0] = DotProduct3;
COLORARG1[0] = Texture;
COLORARG2[0] = TFactor;
TexCoordIndex[0] = 1;

COLOROP[1] = Modulate;
COLORARG1[1] = Texture;
COLORARG2[1] = Current;
TexCoordIndex[1] = 0;

magFilter[2]=Linear;
minFilter[2]=Linear;
mipFilter[2]=Linear;
COLOROP[2] = AddSigned;
COLORARG1[2] = Texture;
COLORARG2[2] = Current;
TexCoordIndex[2] = 1;

magFilter[3]=Linear;
minFilter[3]=Linear;
mipFilter[3]=Linear;
COLOROP[3] = AddSigned;
COLORARG1[3] = Texture;
COLORARG2[3] = Current;
TexCoordIndex[3] = 1;
}
}



Screenshot when "create meshes" is off:
www.upforums.com/temp2.jpg

Screenshot when "create meshes" is on:
www.upforums.com/temp1.jpg
Posted By: CBSection31

Re: Block bump mapping with "create meshes" on (A7) - 09/07/07 18:45

Here is a quick update: I tried compiling the level with that wall set to flat, as opposed to shaded. The crazy light is gone, but in its place is the wrong color. Take a look here: www.upforums.com/temp3.jpg . I hope this helps!
Posted By: xXxGuitar511

Re: Block bump mapping with "create meshes" on (A7) - 09/08/07 05:31

make sure the shader is using the right texcoords for the lightmap/texture scale lookup. I'm not sure what these are, but using shaders on geometry is definatly different than on models. Maybe the manual will say...
Posted By: Tor

Re: Block bump mapping with "create meshes" on (A7 - 09/09/07 06:23

um where's the vertex shader or the compile shader call?
Posted By: CBSection31

Re: Block bump mapping with "create meshes" on (A7 - 09/09/07 06:25

Thank you for your responses. I'm afraid I know nothing about shader programming. I got this code from AUM. Should I be using a different shader code entirely?
Posted By: Machinery_Frank

Re: Block bump mapping with "create meshes" on (A7 - 09/09/07 08:09

Quote:

um where's the vertex shader or the compile shader call?




This is a fixed function effect and does not need to compile.
© 2024 lite-C Forums