Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,244 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Block bump mapping with "create meshes" on (A7) #152521
09/07/07 18:33
09/07/07 18:33
Joined: Oct 2005
Posts: 131
C
CBSection31 Offline OP
Member
CBSection31  Offline OP
Member
C

Joined: Oct 2005
Posts: 131
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

Last edited by CBSection31; 09/07/07 18:35.
Re: Block bump mapping with "create meshes" on (A7) [Re: CBSection31] #152522
09/07/07 18:45
09/07/07 18:45
Joined: Oct 2005
Posts: 131
C
CBSection31 Offline OP
Member
CBSection31  Offline OP
Member
C

Joined: Oct 2005
Posts: 131
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!

Re: Block bump mapping with "create meshes" on (A7) [Re: CBSection31] #152523
09/08/07 05:31
09/08/07 05:31
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
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...


xXxGuitar511
- Programmer
Re: Block bump mapping with "create meshes" on (A7 [Re: xXxGuitar511] #152524
09/09/07 06:23
09/09/07 06:23
Joined: Apr 2006
Posts: 136
San Francisco
T
Tor Offline
Member
Tor  Offline
Member
T

Joined: Apr 2006
Posts: 136
San Francisco
um where's the vertex shader or the compile shader call?


"Towlie, you're the worst character ever." I know...
Re: Block bump mapping with "create meshes" on (A7 [Re: Tor] #152525
09/09/07 06:25
09/09/07 06:25
Joined: Oct 2005
Posts: 131
C
CBSection31 Offline OP
Member
CBSection31  Offline OP
Member
C

Joined: Oct 2005
Posts: 131
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?

Re: Block bump mapping with "create meshes" on (A7 [Re: Tor] #152526
09/09/07 08:09
09/09/07 08:09
Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
Machinery_Frank Offline
Senior Expert
Machinery_Frank  Offline
Senior Expert

Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
Quote:

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




This is a fixed function effect and does not need to compile.


Models, Textures and Games from Dexsoft

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1