Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Help with Wiki Terrain Shadowmapping #58293
11/01/05 14:33
11/01/05 14:33
Joined: Jun 2005
Posts: 656
G
Grafton Offline OP
User
Grafton  Offline OP
User
G

Joined: Jun 2005
Posts: 656
Has anyone got this to work well? When I try to use the code, it shades the entire terrain! I am using an all white(255,255,255) 24 bit tga as the second texture on the hmp. Anyone have any luck with this?
Thanks for any ideas!


Not two, not one.
Re: Help with Wiki Terrain Shadowmapping [Re: Grafton] #58294
11/01/05 16:25
11/01/05 16:25
Joined: Nov 2003
Posts: 1,267
ef
C
Christoph_B Offline
Serious User
Christoph_B  Offline
Serious User
C

Joined: Nov 2003
Posts: 1,267
ef
don't use a skybox when calculating the shadowmap, because it will shadow the whole terrain.


sef
Re: Help with Wiki Terrain Shadowmapping [Re: Christoph_B] #58295
11/01/05 16:53
11/01/05 16:53
Joined: Jun 2005
Posts: 656
G
Grafton Offline OP
User
Grafton  Offline OP
User
G

Joined: Jun 2005
Posts: 656
Thanks Christoph, and I am just using an empty scene with a hmp in it, no sky box or anything to get in the way of the trace. Puzzling!


Not two, not one.
Re: Help with Wiki Terrain Shadowmapping [Re: Grafton] #58296
11/01/05 22:43
11/01/05 22:43
Joined: Jun 2005
Posts: 656
G
Grafton Offline OP
User
Grafton  Offline OP
User
G

Joined: Jun 2005
Posts: 656
Ok, I got it working! It seems that c_trace was returning the length of the trace instead of a 0 even when nothing is hit! I used all the flags, Is this a known problem, or maybe I am not doing something correctly?

What I am doing as a work-around, is comparing the trace length to the distance of the target pixel, and then shading the pixel if the trace is shorter.


Not two, not one.
Re: Help with Wiki Terrain Shadowmapping [Re: Grafton] #58297
11/01/05 22:48
11/01/05 22:48
Joined: Dec 2000
Posts: 4,608
mk_1 Offline

Expert
mk_1  Offline

Expert

Joined: Dec 2000
Posts: 4,608
undocumented feature. download the new beta manual. trace_hit returns 1 if target is hit.


Follow me on twitter
Re: Help with Wiki Terrain Shadowmapping [Re: mk_1] #58298
11/02/05 12:02
11/02/05 12:02
Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
BlueBeast Offline
Serious User
BlueBeast  Offline
Serious User

Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
Seems like you got it, But I know Dennis_Fantasy has done this successfully for me so if you have any more questions, he'd be my first suggestion. But then, I don't know EVERYBODY who's done it, he's the only one I know in this case.

Jason


Gamestudio Pro 6.4
Pentium 4 3.0 GHz 800MHz BUS
AtiRadeon 9800 pro 256Mb 21" Monitor
1 Gig DDR RAM
36 Gig RAPTOR SATA+ 120 Gig SATA
SB Audigy 2 w/ 450 watt Logitech Z680 5.1

www.nordicepitaph.com
Re: Help with Wiki Terrain Shadowmapping [Re: BlueBeast] #58299
11/03/05 00:30
11/03/05 00:30
Joined: Jun 2005
Posts: 656
G
Grafton Offline OP
User
Grafton  Offline OP
User
G

Joined: Jun 2005
Posts: 656
Thanks Jason!

A big problem I was having was that the script uses the terrains bounding box and origin to get its size and XY center. If the origin is off, it gets messed up. I fixed this by changing the function to use the terrains corner vertices instead.

Also the script is made for HMP's and not MDL's such as I neeeded, so I hade to remove "ignore_models" a c_trace function was using .

An interesting note for anyone else using this script, The uv mapping has to
be in the correct orientation. It was drawing the shadows in the wrong places for me until I rotated the mapping 90 degress CCW in MED

I got more realistic shadows (IMO), by keeping the "suns" position at the same relative position (offset) to each pixel checked rather than all the traces coming from the same point. This probably looks better because the real sun is so far away it seems to cast somewhat parallel shadows.

I added the wiki "TGA write" script to this too, it works great! Load the terrain, press enter and out comes the tga shadow map! (well, almost that easy! ).


Not two, not one.

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