Shadow converter
Thank You
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.
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
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
Re: Shadow converter
Very good idea.
But wouldn't that call for more bytes? And thus longer loading time?
But wouldn't that call for more bytes? And thus longer loading time?
Re: Shadow converter
Will the new shadows be implemented in the next update?
EDIT:
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.
EDIT:
Very good idea.
But wouldn't that call for more bytes? And thus longer loading time?
Nice coffee is always nice.
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.
But wouldn't that call for more bytes? And thus longer loading time?
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
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.
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?
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?
Re: Shadow converter
(...)
Probably, unless we encounter issues or something.
Nice coffee is always nice.
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
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
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?
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?
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
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
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
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
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
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.
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.
King Karolus Servant
Posts: 2154
Joined: 29 Aug 2007, 22:00
KaM Skill Level: Veteran
Location: In his dark thunderstormy castle
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
What's that?
Re: Shadow converter
*derp*
We have "Winter".
Meaning it is about 10 degrees Celsius warmer than any winter I have seen.
We have "Winter".
Meaning it is about 10 degrees Celsius warmer than any winter I have seen.
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.
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 ). 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.
Nice coffee is always nice.
Return to “Feedback / Discussion”
Who is online
Users browsing this forum: No registered users and 11 guests