Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by 7th_zorro. 04/27/24 04:42
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (Akow, 7th_zorro, VoroneTZ, PeroPero), 812 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 4
Page 4 of 14 1 2 3 4 5 6 13 14
Re: Bump Mapping Shader [Re: er_willy] #22170
01/22/04 04:47
01/22/04 04:47
Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
Drew Offline
Serious User
Drew  Offline
Serious User

Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
it's not using the 'ambient values' of the level...
Can this be added? (wish I knew how)



Drew Medina
Game Developer (Artist)
Personal & professional website
Deviant Art
My Blogspot
Re: Bump Mapping Shader [Re: Drew] #22171
01/22/04 06:40
01/22/04 06:40
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
i think conitec should provide a simple example for a shader which does exactly the same lighting as the default mat_model does. with ambient, albedo and all that things considered... i couldn't reproduce the mat_model lighting behavior yet. with an example it would be quite easy to combine that lighting with shaders like this bump mapping one...

Re: Bump Mapping Shader [Re: ventilator] #22172
01/22/04 10:44
01/22/04 10:44
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Use

COLOROP[1] = modulate2x;

instead.

The default model ColorOp is modulate2x. The material color values can just be copied from mat_model like in the effects.wdl example.

Re: Bump Mapping Shader [Re: jcl] #22173
01/22/04 10:55
01/22/04 10:55
Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
Drew Offline
Serious User
Drew  Offline
Serious User

Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
can somebody add that to the code (for us shader noobs)?


Drew Medina
Game Developer (Artist)
Personal & professional website
Deviant Art
My Blogspot
Re: Bump Mapping Shader [Re: jcl] #22174
01/22/04 11:22
01/22/04 11:22
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
actually i didn't really investigate this bump mapping example. i knew that if you set the directx states it's possible to achieve the same lighting as with mat_model...

but i haven't been able to achieve the same lighting with a pure vertex and pixelshader combination (using veclight and so on). i don't know how to combine the influence of the shadowmap and other lightsources in the right way. a simple example for this would be nice!

...
@drew:

COLOROP[0] = dotproduct3;
COLORARG1[0] = texture;
COLORARG2[0] = diffuse;

COLOROP[1] = modulate2x; // here
COLORARG1[1] = texture;
COLORARG2[1] = current;

Re: Bump Mapping Shader [Re: ventilator] #22175
01/22/04 16:30
01/22/04 16:30
Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
Drew Offline
Serious User
Drew  Offline
Serious User

Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
ok, thanks... What that (modulate2x) did was to just bring the brightest levels up, the ambient is still black.



Drew Medina
Game Developer (Artist)
Personal & professional website
Deviant Art
My Blogspot
Re: Bump Mapping Shader [Re: Drew] #22176
01/22/04 17:13
01/22/04 17:13
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
i think the vertex shader would have to do the same lighting calculation (with the shadowmap, albedo and everything taken into account) as the engine does for models without any shader and then pass the result to a third stage which applies the lighting. but i don't know how the engine calculates the lighting and so a simple vertex shader example by conitec would be nice!

Re: Bump Mapping Shader [Re: ventilator] #22177
01/23/04 01:02
01/23/04 01:02
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Yes, ventilator is right.

This is the default render setting used by the engine:

Models, sprites, and flat textures:

SetTexture(0,Skin);
SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_MODULATE2X);
SetTextureStageState(0,D3DTSS_COLORARG1,D3DTA_TEXTURE); // entity texture
SetTextureStageState(0,D3DTSS_COLORARG2,D3DTA_DIFFUSE); // lighting


Shaded textures:

Stage 0 adds dynamic lights to the lightmap:

SetTexture(0,LightMap);
SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_ADD);
SetTextureStageState(0,D3DTSS_COLORARG1,D3DTA_TEXTURE); // lightmap
SetTextureStageState(0,D3DTSS_COLORARG2,D3DTA_DIFFUSE); // lighting

Stage 1 modulates the actual texture with the result of stage 0:

SetTexture(1,Texture);
SetTextureStageState(1,D3DTSS_COLOROP,D3DTOP_MODULATE2X);
SetTextureStageState(1,D3DTSS_COLORARG1,D3DTA_TEXTURE); // texture
SetTextureStageState(0,D3DTSS_COLORARG2,D3DTA_CURRENT); // stage 0


The shader must emulate this setting.

Re: Bump Mapping Shader [Re: jcl] #22178
01/23/04 06:28
01/23/04 06:28
Joined: Nov 2003
Posts: 698
England, UK
A
Aaron_H Offline
User
Aaron_H  Offline
User
A

Joined: Nov 2003
Posts: 698
England, UK
Excuse me about this, but isn't there bump mapping with the engine, without the need for shaders?

Sorry, but I don't know anything about shaders or anything, so maybe someone could help me on this one.

Re: Bump Mapping Shader [Re: Aaron_H] #22179
01/23/04 07:17
01/23/04 07:17
Joined: Apr 2001
Posts: 425
Pittsburgh PA
RAFU Offline
Senior Member
RAFU  Offline
Senior Member

Joined: Apr 2001
Posts: 425
Pittsburgh PA
good question... Hmmmmmm.. No
Need shaders:)



INTENSE X: The ultimate plug-in for Gamestudio. Available now!
Join our Forums now! Discuss, Vote and win Free Upgrades!
Page 4 of 14 1 2 3 4 5 6 13 14

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