Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Paper mario style with shadows possible?

Author
Message
Timshark
16
Years of Service
User Offline
Joined: 30th Jun 2007
Location: Oslo, Norway
Posted: 28th Mar 2013 19:32
Hi. Im evaluating different engines for my project and wonder if AppGameKit (I own it) could be used.
I want to do the following:

The style should be like paper marionettes. Flat 2d sprites in a 3d world. Like mario paper.
The reason is that I want the flat 3d sprites (planes) to cast realtime shadows based on the lighting setup.
I also want to be able to animate the 3d sprites using spritesheets or preferably using Spines Json-format:

http://esotericsoftware.com/

Is this possible with the current release?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 28th Mar 2013 19:37
This might be possible with the right shader but I haven't seen a good shadow shader used in AppGameKit yet...


this.mess = abs(sin(times#))
Timshark
16
Years of Service
User Offline
Joined: 30th Jun 2007
Location: Oslo, Norway
Posted: 28th Mar 2013 22:09 Edited at: 29th Mar 2013 01:43
Thanks Baxslash.
btw: forgot to mention I'm relating this to Tier 1.
The agk roadmap says there will be shader commands in the future. if I start today will shadows be possible in the near future of agk (built in)? The shadows and lighting will only be effects - so I could start building and add the effects later.

And also - do you know any good resource or tutorial about animating textures on 3d object?

T.
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 28th Mar 2013 22:36
I've made a vertex shader for animating textures. I'll post the shader and example code a little later when I'm at the computer unless someone else does it first

My hovercraft is full of eels
Daniel TGC
Retired Moderator
17
Years of Service
User Offline
Joined: 19th Feb 2007
Location: TGC
Posted: 28th Mar 2013 22:51 Edited at: 28th Mar 2013 22:51
I've just had a look at paper mario world. You don't need to use shaders for that shadow, just slap a oblong png based into a sprite or texture a plane with it, and you're done. It's basically just a semi-transparent oblong that follows your character around.

Timshark
16
Years of Service
User Offline
Joined: 30th Jun 2007
Location: Oslo, Norway
Posted: 28th Mar 2013 22:52 Edited at: 28th Mar 2013 23:03
Sounds great! Looking forward to it, lilpisswilly.

Have a feeling AppGameKit could be my choice.
I'll start coding and keep prototyping the look of it in blender.

Daniel: Yes, but I want the full shadow with details. Hitting the wall behind the sprites. or other sprites. I want it to have the look of a paper marionette stage.
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 28th Mar 2013 23:34 Edited at: 28th Mar 2013 23:35
Here you go. Now bear in mind that the texture should be a power of two image, which I haven't included. The image included works on PC but it won't on Android or iOS.

You can explore it, I'll tell you briefly how it works:

uvScaleX# and uvScaleY# when set to 1.0 will show the entire texture-image on your object. This means that if you have two frames on your texture-image you would set the uvScaleX# to 0.5 and the image would then be twice as large as the object plane. You would then change the offset of the texture with uvScrollX# by switching it between 0.0 and 0.5.

In short, if you use the function initTextureAnimation included and only use images with one row of sprites it will work. If you have more than one row you would have to change uvScaleY# accordingly.

I haven't made functions for stopping, starting and setting the speed of the animation yet but you have something to go on here I think.

If I have explained this inadequately let me know.

My hovercraft is full of eels

Attachments

Login to view attachments
Timshark
16
Years of Service
User Offline
Joined: 30th Jun 2007
Location: Oslo, Norway
Posted: 29th Mar 2013 01:48
Great. I'll dive into to it. Changing the offset is a nice idea. Don't know how fast it is. I'll check it out.

Let the morning come.

Thanks.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 29th Mar 2013 11:13
One thing to keep in mind, whether it's a sprite or a plain - you can always change the colour to black, and the alpha to 128 (or something), and you have a shadow version.

So maybe, rather than having an oblong shadow - you could have a copy of the sprite, coloured black and 128 alpha, invert it on Y, scale it on Y by half, and you have a rather neat shadow effect. Have it move down by half the speed the player moves up - so it's like the shadow is projected.
You can also have the shadow behind the sprite, like as if the main light source is above and in front of the sprite, rather than above and behind.

I often change the colour of a sprite and it's alpha to make a shadow version - it's cheap and effective, what more could we ask .

I got a fever, and the only prescription, is more memes.

Login to post a reply

Server time is: 2024-05-06 22:03:24
Your offset time is: 2024-05-06 22:03:24