Page 3 of 3

Re: Shadow converter

PostPosted: 12 Jan 2012, 16:52
by GreatWhiteBear
yeah, not a hot summer, not a cold winter.
I think the average is about 13degrees Celsius.

Re: Shadow converter

PostPosted: 13 Jan 2012, 05:30
by Krom
@Lewin: You right.

Although it would be interesting to test, with fuzziness gong from 0 to e.g. 5px (as on screens)

Re: Shadow converter

PostPosted: 13 Jan 2012, 12:24
by Lewin
Although it would be interesting to test, with fuzziness gong from 0 to e.g. 5px (as on screens)
I still think it would end up looking tacky, but I'm happy to look at an example screenshot and reconsider.

Re: Shadow converter

PostPosted: 22 Jan 2012, 11:46
by kocsis1david
I've updated it (http://dl.dropbox.com/u/28475953/KaM/Ka ... nverter.7z):
ImageImage

Now there are 3 settings in "settings.txt":
1st: Shading level
2nd: Blurness
3rd: Sharpness in low distances, if you set it to 0, there won't be distance-dependent shadows

Re: Shadow converter

PostPosted: 22 Jan 2012, 13:39
by Krom
Tree looks great :)
Is it possible to smooth out house outlines, so they would be not as jaggy?

Re: Shadow converter

PostPosted: 22 Jan 2012, 14:34
by kocsis1david
Yes, but I don't find it jaggy with 1280×720 display resolution. Which house is jaggy?

Re: Shadow converter

PostPosted: 22 Jan 2012, 14:59
by Krom
The Store house - see the shadow edge and line I put next to it.

Re: Shadow converter

PostPosted: 22 Jan 2012, 16:00
by Siegfried
I'm not sure if Krom meant the same, but the diagonal edge on the lower right still shows pixels. Maybe it's possible to apply antialiasing?

Re: Shadow converter

PostPosted: 22 Jan 2012, 16:56
by kocsis1david
I thought you indended the house itself. I made a little shadow shape correction:
ImageImageImage

The sharp edges are still not perfect, but it might not visible in the game.

Re: Shadow converter

PostPosted: 27 Jan 2012, 07:56
by Lewin
We've done most of the work to add alpha-shadows to the game, here's a new screenshot:

Image

As you can see it looks great, and believe me it looks even better when you see the units walking and the shadows animating!

@kocsis1david: To make it easier for us I was wondering whether you could change the output to not have .new. (so MyFile.bmp becomes MyFile.png rather than MyFile.new.png) That will save me using a batch renamer every time. I modified the BMX file to not have .new, but it didn't make any different so I assume the script is compiled not interpreted and you just provided the BMX file so we can see what it is doing.
I guess you used .new so it could load PNG files without overwriting the input file, but we're only loading BMPs at the moment and if it overwrote the input file that wouldn't matter anyway.
Thanks for all your help :)

Re: Shadow converter

PostPosted: 27 Jan 2012, 13:25
by kocsis1david
I've changed it to use the same filename. Could you tell me when the new update will be?

Re: Shadow converter

PostPosted: 27 Jan 2012, 17:00
by Lewin
Thanks :) Not sure when the update will be, 1 month at the earliest I'd say, there's still some stuff we have to do.

Re: Shadow converter

PostPosted: 07 Jul 2012, 10:09
by Lewin
Over the past month or so Krom has been refactoring our sprite loading/packing process to make it much easier to use, and so we can eventually provide an editor to open our sprite packs (.rxx files found in data\Sprites) and edit them.

We wanted the process of generating these files to be as simple as possible for us, so I have implemented kocsis1david's shadow converting algorithm natively into our process, by "translating" his code into Pascal.

Before today generating the soft shadowed sprites was a lot of manual work: exporting all the images from the game, running the shadow converter over them, then importing all those images back into the game along with the team color masks and finally generating the RXX file. When I did that for r3392 it took a good 20 minutes! Now all of that is done with the click of a button and a few minutes of CPU time.

@kocsis1david: Thank you very much for providing the algorithm, (and the actual idea to improve the shadows) I hope you don't have any issues with us implementing it in our own source code.

Re: Shadow converter

PostPosted: 07 Jul 2012, 14:09
by kocsis1david
Okey, You're welcome. Actually it didn't take so much effort.

Re: Shadow converter

PostPosted: 07 Jul 2012, 16:15
by FeyBart
This all sounds very sweet.