Map Database  •  FAQ  •  RSS  •  Login

Shadow converter

<<

kocsis1david

Crossbowman

Posts: 204

Joined: 12 Mar 2011, 23:00

KaM Skill Level: Skilled

Location: Hungary

Post 03 Jan 2012, 17:33

Re: Shadow converter

Thank You
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 11 Jan 2012, 11:58

Re: Shadow converter

Would it be possible to make shadow opacity and fuzziness to depend on distance from bottom of the sprite?
So that like in real-life sunlight, shadow near the object was darker and with sharp edges, but farther from object it became fuzzy and lighter.
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

GreatWhiteBear

Knight

Posts: 578

Joined: 13 Sep 2011, 22:00

Location: The Netherlands

Post 11 Jan 2012, 13:05

Re: Shadow converter

Very good idea.
But wouldn't that call for more bytes? And thus longer loading time?
<<

FeyBart

User avatar

Knight

Posts: 402

Joined: 28 Dec 2011, 16:35

KaM Skill Level: Beginner

Location: Nutville, NL

Post 11 Jan 2012, 13:05

Re: Shadow converter

Will the new shadows be implemented in the next update?

EDIT:
Very good idea.
But wouldn't that call for more bytes? And thus longer loading time?
I thought I read Lewin say something about 3x faster loading times for the next update? Not sure though. Anyway, in that case it would mean there's hardly any problem with it.
Nice coffee is always nice.
<<

kocsis1david

Crossbowman

Posts: 204

Joined: 12 Mar 2011, 23:00

KaM Skill Level: Skilled

Location: Hungary

Post 11 Jan 2012, 13:16

Re: Shadow converter

Would it be possible to make shadow opacity and fuzziness to depend on distance from bottom of the sprite?
So that like in real-life sunlight, shadow near the object was darker and with sharp edges, but farther from object it became fuzzy and lighter.
Yes, but I think distance from bottom is not equivalent to the real distance, so it may not look as natural. I'll make it soon amd we'll see it.
But wouldn't that call for more bytes? And thus longer loading time?
I don't think so, but even if it would, it wouldn't be significant.
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 11 Jan 2012, 13:29

Re: Shadow converter

Would it be possible to make shadow opacity and fuzziness to depend on distance from bottom of the sprite?
So that like in real-life sunlight, shadow near the object was darker and with sharp edges, but farther from object it became fuzzy and lighter.
I think that's hard to implement without 3D information about the sprites. Take the storehouse image. The shadow is cast from the right edge of the building, so it should be darkest along the left edge of the shadow, and faintest at the top right. If we did that sprite top to bottom, it would look like the shadow is being cast from the wrong place. If anything it should be bottom-left to top-right as that is the direction of the shadows, but I still think it might look odd on some sprites. I'd have to see a sample :)
EDIT: I mean the same thing as kocsis1david, he wrote it more concisely.
Very good idea.
But wouldn't that call for more bytes? And thus longer loading time?
Did you mean these shadows in general, or Krom's last post?
In general the shadows will use more RAM, but I'm not sure how much. Most of the loading time is currently spent on loading PNGs inefficiently. ("additional sprites") Loading zipped RGBA sprites is slightly slower than loading the original palleted files, but overall loading is still ~3x faster because loading RGBA is much faster than loading PNGs.
Krom's suggestion won't use more bytes or take longer to load than shadows without it.
Will the new shadows be implemented in the next update?
Probably, unless we encounter issues or something.
<<

FeyBart

User avatar

Knight

Posts: 402

Joined: 28 Dec 2011, 16:35

KaM Skill Level: Beginner

Location: Nutville, NL

Post 11 Jan 2012, 13:31

Re: Shadow converter

(...)
Probably, unless we encounter issues or something.
Nice. :-)
Nice coffee is always nice.
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 11 Jan 2012, 15:31

Re: Shadow converter

Right, but trying that out could be interesting and maybe it will look OK.
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

kocsis1david

Crossbowman

Posts: 204

Joined: 12 Mar 2011, 23:00

KaM Skill Level: Skilled

Location: Hungary

Post 11 Jan 2012, 16:08

Re: Shadow converter

Yeah, but we'll probably need a better algorithm to estimate the distance.

EDIT:
I have an idea: Max(X / Width, 1 - Y / Height). I think this would be almost good if we consider house as a cube. What do you think?
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 12 Jan 2012, 06:07

Re: Shadow converter

As Lewin said - there are many sprites and each one is special in a way. Algo looks good, but without seeing actual result it's hard to tell ;)
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 12 Jan 2012, 13:53

Re: Shadow converter

Today I was looking at real shadows of buildings and trees, and I found they are about the same darkness at the top and bottom of the shadow, unless it's REALLY high (like a 4+ level building, and even then the difference is barely noticeable, just the edges are fuzzier) For 1-2 level houses in KaM and average size trees, I don't think the shadows would be any different at the top or bottom, or if they are, it should be VERY subtle. From the distance we view KaM the fuzzy edges won't be a noticeable difference IMO.

When simulating sunlight, you treat the light source as infinity far away. (meaning every ray of light is parallel to every other ray, unless you are on a REALLY big scale) This means that any part of the ground which does not have a line of sight to the sun will be in full shadow, and only illuminated by ambient light bouncing off other objects. That means all parts of the ground have the same darkness.

So having considered it I don't think this is necessary, or if it is, it should be very subtle.

Take a look when you next outside, you'll hardly notice a difference between areas of shadows. (unless it's partial shadow through foliage, but that's a different story) Mind you, I don't know whether there's much sun in Europe at the moment, it's the middle of summer here ;)
<<

Siegfried

User avatar

Knight

Posts: 494

Joined: 24 Jul 2009, 22:00

Post 12 Jan 2012, 14:04

Re: Shadow converter

Well, the color of shadows is the same all over the shadow. The only thing that changes is the fuzziness of the edges. The more you go away from the light blocker, the fuzzier the shadow edge becomes. That's the effect of diffraction. But the lightness stays the same all over the shadow.

But I don't see any necessity to implement this into KaM. This only becomes important for narrow objects which KaM doesn't have apart from flagpole.
<<

The Dark Lord

User avatar

King Karolus Servant

Posts: 2154

Joined: 29 Aug 2007, 22:00

KaM Skill Level: Veteran

Location: In his dark thunderstormy castle

Post 12 Jan 2012, 14:25

Re: Shadow converter

Mind you, I don't know whether there's much sun in Europe at the moment, it's the middle of summer here ;)
Sun?

What's that? :P
<<

GreatWhiteBear

Knight

Posts: 578

Joined: 13 Sep 2011, 22:00

Location: The Netherlands

Post 12 Jan 2012, 14:34

Re: Shadow converter

*derp*
We have "Winter".
Meaning it is about 10 degrees Celsius warmer than any winter I have seen.
<<

FeyBart

User avatar

Knight

Posts: 402

Joined: 28 Dec 2011, 16:35

KaM Skill Level: Beginner

Location: Nutville, NL

Post 12 Jan 2012, 16:30

Re: Shadow converter

Well, the color of shadows is the same all over the shadow. The only thing that changes is the fuzziness of the edges. The more you go away from the light blocker, the fuzzier the shadow edge becomes. That's the effect of diffraction. But the lightness stays the same all over the shadow.

But I don't see any necessity to implement this into KaM. This only becomes important for narrow objects which KaM doesn't have apart from flagpole.
I think fuzziness of shadows wouldn't be necessary to implement.

A real shadow of a 5 meters high object would have a blurry edge of about two centimeters (doing this in centimeters and meters because I have no idea how big a foot or inch is :P). So assuming the buildings in KaM are about 5 meters high, and the scale would be something like 250:1, the fuzzy edge would be around 0,8 millimeters wide.
*derp*
We have "Winter".
Meaning it is about 10 degrees Celsius warmer than any winter I have seen.
Haha, I think the overall difference between our summer and the winter we have right now, is around 5 degrees Celsius. :P
Nice coffee is always nice.

Return to “Feedback / Discussion”

Who is online

Users browsing this forum: No registered users and 15 guests