Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (Ayumi, NewbieZorro, TipmyPip), 13,887 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: 2 pass rendering [Re: Matt_Aufderheide] #19964
04/23/04 08:51
04/23/04 08:51
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
i still don't understand how this works.

i have an effect which uses 3 texture stages:

colormap
detailmap
shadowmap

the shadow map does only contain shadows and no lighting information (white = no shadow, black = shadow). so i use modulate and not modulate2x.

for older cards i would like to render the shadow map in a second pass.

i enabled alpha blending and tried all

SrcBlend
DestBlend

combinations but nothing worked properly. what exactly is the source and what the destination? what do i have to set as colorop in the second pass? how does rendering such an effect in two passes work? do i need an alpha channel?

Re: 2 pass rendering [Re: ventilator] #19965
04/23/04 10:36
04/23/04 10:36
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline
Serious User
Steempipe  Offline
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
I have been screwing with this a little too. To see Pass p0 an p1 you will
need to look at the fixed-function multitex at my site/





The basic way I am adding a shadow map is this way, and it is happening
in Pass p2:

Pass p0
{
.... lay down the base skin
.... using tex[0]
}

Pass p1
{
.... Add a second texture using an alphamap
.... Using Texture 0,1
}

Pass p2
{

alphaop[0]=disable; // Frame buffer is filled, but no alphaops wanted

alphablendenable=true;

SRCBLEND=ZERO; // <<<<<<<<<<<<<
DESTBLEND=SRCCOLOR; // <<<<<<<<<<<<<

zenable=true;
zwriteenable=true;
ditherenable=true;

Texture[1] = <mtlSkin2>;

magFilter[1]=linear;
minFilter[1]=linear;
mipFilter[1]=linear;

TextureTransformFlags[1] = disable;

texcoordindex[1]=1;

}

Re: 2 pass rendering [Re: Steempipe] #19966
04/23/04 22:13
04/23/04 22:13
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
thanks! i got it to work. the reason for the problem was this:

first pass:

colormap
detailmap

second pass:

shadowmap
disable

if you don't disable the second texture stage of the second pass it uses the same settings as in the first pass which leads to strange results!

Re: 2 pass rendering [Re: ventilator] #19967
04/24/04 10:03
04/24/04 10:03
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline
Serious User
Steempipe  Offline
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
I see...

Your note about disabling the pass 2/ stage 2 operations made sense.

I made a new project, did not do any masking of textures and disabled the 2nd stage of pass 2. In the earlier reply I think I had to disable AlphaOp because I was using alphamap in the previous passes. I suppose I could have done that in the 2nd stage as well.

Here are some shots for comparing shadow, diffuse light, and just a detail map.
web page

Page 2 of 2 1 2

Moderated by  Blink, Hummel, Superku 

Gamestudio download | 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