Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Akow, 1 invisible), 1,499 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Shadowmapping terrain [Re: Damocles] #180912
01/30/08 23:40
01/30/08 23:40
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
Quote:

When i align sun and shadow, then the mix of dynamic lightning of the terrain and the "baked" shadow will look better.


ah! that explains why the difference looks that extreme.

i still would use a lighting equation though. i don't think that a single vec_dot() would make the calculations take a minute longer. it shouldn't be noticable. what computationally intensive method did you use?

Re: Shadowmapping terrain [Re: ventilator] #180913
01/30/08 23:49
01/30/08 23:49
Joined: Jan 2003
Posts: 4,305
Damocles Offline OP
Expert
Damocles  Offline OP
Expert

Joined: Jan 2003
Posts: 4,305
I use a quite "straigt forward" approach in C-script with traces, and painting pixels

For the project I have to do a thousand other things like cinematics, triggers, unit-actions/spells etc

So i cant put much time into the shadowbaking for now.

i will come back to your suggestions later in the project.

Re: Shadowmapping terrain [Re: Damocles] #180914
01/31/08 08:12
01/31/08 08:12
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
There is a quite easy approach to render soft lights direclty while you raytrace the pixels of your terrain.

Dont use a single point for the sun - use an area. If you use a squared area then you have 4 points available. Every pixel of the terrain traces to all 4 points.

So if it happens that it hits all 4 of them then it gets full sun light.

If it hits none it is in full shadow.

If it hits only 2 of them it is in half shadow.

The size of the rectangled sun influences the size of the soft-shadows.

The calculation will take 4-times your current time but it might be worth it.
The quality can be better, when you rotate the rectangle like this:
Code:

x
x x x
x




Models, Textures and Games from Dexsoft
Re: Shadowmapping terrain [Re: Machinery_Frank] #180915
01/31/08 11:41
01/31/08 11:41
Joined: Jan 2003
Posts: 4,305
Damocles Offline OP
Expert
Damocles  Offline OP
Expert

Joined: Jan 2003
Posts: 4,305
I did that in the previous shadowrenderer.
But the probelem is, that the Terrain does not have a resolution
high enough, to make the "curves" in the terrain look smooth.
So when the part of the terrain has a thin angle, so that it is almost in the shadow,
it will be drawn darker. But this makes hard edges between the faces of the terrain,
looking unrealistic.

Thats why I want only tweo choises "dark" or "lit". The smoothing removes hard edges in the
postprocessing.

The "fine" shadow/light differences will then come from the dynamic lightning of the terrain.


in the video you can see that the terrain looks quite nice ingame:

http://de.youtube.com/watch?v=hyRrjEBkA6g



Here with wather. Its quite Flat, so i have to look for a shader that makes it look good, but
does not drain performance.



Re: Shadowmapping terrain [Re: Damocles] #180916
01/31/08 19:47
01/31/08 19:47
Joined: Aug 2005
Posts: 1,012
germany, dresden
ulf Offline
Serious User
ulf  Offline
Serious User

Joined: Aug 2005
Posts: 1,012
germany, dresden
wow, i really like your style damocles. its looking simple but effective. thats a good basis for an fps.

can you tell me how you move your units? because i get strange behaviour described in this thread:

http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/814408/an/0/page/0#Post814408

when i move something with a constant speed pretty fast in windowed mode. have you tried running in windowed mode?

Re: Shadowmapping terrain [Re: ulf] #180917
01/31/08 19:51
01/31/08 19:51
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
@ Damocles:

That looks nice and flexible
Thanks for commenting your shadow methode.

Cheers

Frazzle


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: Shadowmapping terrain [Re: ulf] #180918
01/31/08 20:02
01/31/08 20:02
Joined: Jan 2003
Posts: 4,305
Damocles Offline OP
Expert
Damocles  Offline OP
Expert

Joined: Jan 2003
Posts: 4,305
The demo on the video was actually taken from a windowed game. (fraps only recorded the window)

I only use fps_max=60; and everything with a time factor.
no timesmooth.

In theory, the movement can only be fluent, if there is no timesmooth,
as this is exactly the timeshift between two frames.

But i think there is a problem when the framerate drops below 16FPS.

Since i have a pretty fast computer now, and alway write the code as fast as possibele, I dont
run into major problems.
Its another thing with slower computers. But on my laptop, the game runs quite smooth too, even when
it is already 5 years old.

I am also very reluctant to shaders/effects, especially if they do not improve the feeling of the game.

The only shader I use is the multi-terraintexture-shader from the templates. (about the only think I find useful for me
from the template source)

Page 2 of 2 1 2

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