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
Terrain with shadows? #79464
06/26/06 08:08
06/26/06 08:08
Joined: Dec 2003
Posts: 112
Kamiomi Offline OP
Member
Kamiomi  Offline OP
Member

Joined: Dec 2003
Posts: 112
(I could have sworn I posted this question, but I can't find it, so I'll ask it again)

I'm using a terrain in my level, and well... I've seen some screenshots here and there, of entities casting shadows on HMP terrains, but nothing casts a shadow on my terrain. It would be nice.

Is that something that is easily done (like I made a mistake somewhere), or does it use a texture projection shader or something?




Re: Terrain with shadows? [Re: Kamiomi] #79465
06/26/06 09:47
06/26/06 09:47
Joined: Jul 2002
Posts: 2,002
Europe
ShoreVietam Offline
Expert
ShoreVietam  Offline
Expert

Joined: Jul 2002
Posts: 2,002
Europe
To have flat shadows of models on terrain just switch their shadow flag on.

Level geometry and levelmaps won't cast shadows.

When you're using shaders to render the terrain they may overwrite your models shadows.
Thus you could write a own shader function to render models shadows.

To have level geometry and level map shadows you'd have to write your own shader or modify the one from the wiki.
Just multiply the result matrix with the .a (alpha) matrix and deactivate alphablendenable and alphatestenable so that the alpha channel is not used for alpha blending but for multiplying the result texture matrix with 0...1 which looks like that:

(The ratrace function to pre-render this shadowmpar tooks 3~5 minutes, thus they really are static.)







My project Schlacht um Kyoto - Das Samurai Browsergame! (sorry, german only)
Re: Terrain with shadows? [Re: ShoreVietam] #79466
06/26/06 10:30
06/26/06 10:30
Joined: Dec 2003
Posts: 112
Kamiomi Offline OP
Member
Kamiomi  Offline OP
Member

Joined: Dec 2003
Posts: 112
I'm just using MDL entities, on a HMP terrain - I just made sure all their shadow flags were on in their actions (trees, and a character), and still, none of them are casting shadows on the terrain...

That really makes me wonder what's going on. I'm not too worried about it because the terrain has a varied texture, and "Serious Grass" to cover it, but still, the shadows would really look nice.



Re: Terrain with shadows? [Re: Kamiomi] #79467
06/26/06 10:44
06/26/06 10:44
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Before you can have some shadows, you need to turn the sun
on in your map properties like this:





Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: Terrain with shadows? [Re: frazzle] #79468
06/26/06 11:17
06/26/06 11:17
Joined: Dec 2003
Posts: 112
Kamiomi Offline OP
Member
Kamiomi  Offline OP
Member

Joined: Dec 2003
Posts: 112
That didn't work.

(I'm kind of glad though, I don't want to set my sun elevation so high, because my camera doesn't look up that far, and I made the most awesome lens flare - so I don't want to miss it)

I hope this isn't an indication of some kind of serious problem in my level - if I don't end up getting shadows to work, I can live with it, but I don't want major errors later on.



Re: Terrain with shadows? [Re: Kamiomi] #79469
06/26/06 19:46
06/26/06 19:46
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
1. add a level block, scale it as large as your terrain(hmp),
texture it of course.

2. place the level block under your terrain(hmp) as close as possible
3. check the shadow flag of your model
4. compile then run

You should see the shadow cast on your terrain(hmp)

Re: Terrain with shadows? [Re: vlau] #79470
06/26/06 20:59
06/26/06 20:59
Joined: Dec 2003
Posts: 112
Kamiomi Offline OP
Member
Kamiomi  Offline OP
Member

Joined: Dec 2003
Posts: 112
thanks vlau, that worked (strange though, I have other blocks in the level that are around the size of the terrain, although they aren't that close underneath it).




Moderated by  HeelX, rvL_eXile 

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