Map Database  •  FAQ  •  RSS  •  Login

Shadow converter

<<

kocsis1david

Crossbowman

Posts: 204

Joined: 12 Mar 2011, 23:00

KaM Skill Level: Skilled

Location: Hungary

Post 01 Jan 2012, 13:03

Shadow converter

I have made a program that can convert shadows:
ImageImage

Download: http://dl.dropbox.com/u/28475953/KaM/Ka ... nverter.7z
To convert images you need to put them in the same folder.
<<

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 02 Jan 2012, 01:07

Re: Shadow converter

Awesome work :) The shadows look very nice and smooth. I'll have to discuss it with Krom (there's a couple of ways we can add an alpha channel, we need to decide on the most efficient one) I'm not even sure whether our textures have a full alpha channel at the moment.
I just ran it on the trees/houses folders, the result is wonderful, this will be a big graphical improvement to the game. Whatever algorithm you're using, it's a damn good one. Once we have it implemented we might need to tweak the level of shading. You seem to have used 40% for completely shadowed areas, which looks pretty good, but it's hard to tell without seeing it in game.
Thank you :)
<<

kocsis1david

Crossbowman

Posts: 204

Joined: 12 Mar 2011, 23:00

KaM Skill Level: Skilled

Location: Hungary

Post 02 Jan 2012, 08:12

Re: Shadow converter

Thanks. I've updated it, because there was an error where the object's edge is black, and the new version reads the multiplier from file, so the shading level can be changed without recompiling.
<<

GreatWhiteBear

Knight

Posts: 578

Joined: 13 Sep 2011, 22:00

Location: The Netherlands

Post 02 Jan 2012, 09:43

Re: Shadow converter

Just out of curiosity, why did you make this and what does it exactly do?
<<

kocsis1david

Crossbowman

Posts: 204

Joined: 12 Mar 2011, 23:00

KaM Skill Level: Skilled

Location: Hungary

Post 02 Jan 2012, 10:03

Re: Shadow converter

Because I think the old shadow doesn't look good, especially when one is on other and it's full black, and I want to do something for KaM Remake. How do you mean that what it does? The algorithm?
<<

GreatWhiteBear

Knight

Posts: 578

Joined: 13 Sep 2011, 22:00

Location: The Netherlands

Post 02 Jan 2012, 10:22

Re: Shadow converter

never mind, I get it now.
Thank you
<<

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 02 Jan 2012, 10:23

Re: Shadow converter

Just out of curiosity, why did you make this and what does it exactly do?
The old shadows in the game use black and transparent pixels in a checker-board pattern. This means it blocks out lots of pixels of the thing under the shadow.
kocsis1david's tool converts these old shadows into semi-transparent shadows, so the thing underneath the shadow is just darkened, rather than having half the pixels made black. This gives you a much nicer looking shadow because you can still see all the detail of the thing underneath it, and the edges are smooth. KaM didn't do it this way because this much alpha blending (semi-transparency) was not really possible on mainstream GPUs in 1998. Once it's implemented I'll make a comparison screenshot for you.

EDIT: I hacked it to work for just trees: Before and after. I used a multiplier of 8, which makes them appear darker than the originals, but we can tweak that easily. I like it, it looks especially good when units are walking through the trees, the shadows look much more natural (but it's hard to capture in a comparison screenshot)
<<

Krom

User avatar

Knights Province Developer

Posts: 3281

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 02 Jan 2012, 12:49

Re: Shadow converter

I like how it looks very much :)

I'va had similar idea in mind, just never had anough free time to implement it. I think we can add the algorithm to texture generator, or just switch to 32bit RX images. Not sure which is better yet.
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 02 Jan 2012, 12:57

Re: Shadow converter

If it would be calculated at loading I think the loading would be much slower even with an optimized version.
<<

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 02 Jan 2012, 15:38

Re: Shadow converter

If it would be calculated at loading I think the loading would be much slower even with an optimized version.
I agree, I think we can use safely switch to RGBA. I've been testing it and the load time is only slightly longer using 32 bit .rxx compared to 8 bit .rx
<<

Encaitar

User avatar

Lance Carrier

Posts: 63

Joined: 13 Oct 2011, 22:00

Location: The Netherlands

Post 02 Jan 2012, 17:53

Re: Shadow converter

Wow, i need to say those comparison screenshot says enough. The game really looks better with those shadows. Congrats and nice work kocsis1david!
<<

GreatWhiteBear

Knight

Posts: 578

Joined: 13 Sep 2011, 22:00

Location: The Netherlands

Post 02 Jan 2012, 18:13

Re: Shadow converter

You still can see the difference between the soldiers shadows and those of the objects.
<<

FeyBart

User avatar

Knight

Posts: 402

Joined: 28 Dec 2011, 16:35

KaM Skill Level: Beginner

Location: Nutville, NL

Post 03 Jan 2012, 14:13

Re: Shadow converter

It indeed looks a lot smoother. Nice work!
Nice coffee is always nice.
<<

T*AnTi-V!RuZz

User avatar

Former Site Admin

Posts: 1826

Joined: 03 Jan 2007, 23:00

KaM Skill Level: Fair

Website: http://www.knightsandmerchants.net

Location: The Netherlands

Post 03 Jan 2012, 14:18

Re: Shadow converter

You still can see the difference between the soldiers shadows and those of the objects.
Of course you can. Read Lewin's post again ;)
<<

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 03 Jan 2012, 15:21

Re: Shadow converter

It looks nice, great work! :)

Return to “Feedback / Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests