shading, shadows, reflections

I think the problem isn't new... so maybe anybody can help to point me in the right direction, threads or whatever.

I like games like "Toy Balls!", "Ballpit", "the fluffies", ... they look and feel great... but...

All these games and some Corona-SDK-examples (Bridge, Chains, Eggbreaker, ...) show the same "imperfection": if you need a round shape look like a ball and not flat like a disc you need shading and maybe also highlights, reflections... if your balls turn around in the game you have to turn the texture to make the turns visible, but the shading and reflection points should stay as far as the light source not moves around - for me it looks a bit dull in all the named examples because shadings and light points turn together with the base texture.

In the meantime I found a solution to go around this - I use 2 or 3 layers of textures, but I think it's not elegant and maybe CPU intensive. Is there a default way to handle this. Anywhere else this was a point of discussion?

Thx and sorry for my English

I ask myself why nobody is stumbling over this...

So I think some of you have a solution for it and all other never noticed this problem.

Most 2d games don't have reflections in my experience, if you want to have them I would do as you are, CPU intensive but just update positions of images to coincide with your original image that is a physics object in Runtime. Easy for a ball, but on more complex shapes I think this could prove difficult and I honestly don't think it will be worth it, actually all that movement may prove to be distracting when playing. Because the game itself is fixed perspective and adding SOME elements of a 3d world and not others could be weird to the eye. U don't think cell shaded images usually move the reflections, goodluck with it though and post a vid if it works well.

Thanks for your response!
I do agree in some points...

My try with 2-3 layers works good for balls and other round object. But it's not working for complex shapes. Maybe it works part wise for lesser complex shapes like ellipses and rounded rectangles

And I agree - a mix of different behaviors is worse than ignoring the rotation of shadings and reflections

But it's not a question of 3D or 2D or 2.5D if you have to use reflections. If you wanna show marbles made of glass or another polished material you need reflections else it looks as something other.

I think it doesn't matter if you use photorealistic shading and reflections or something like cell shading. Both have to fit to the lighting situation.

I'm working on a game idea where I only have static objects (game area) and perfect round moving objects - so I can go for the layer technique.

In Color Sound Machine*, I'm using multiple layers so that the ball looks like it's rolling, but so that the light reflection will always be from above. I'm also not using spritesheets as I ran into issues with Universal-device physics when using spritesheets, so basically I have an invisible parent sprite which is physical, then attached to it (using a sprite.parentId) I have frame images.

This also allows me to smoothly fade certain sprites from one color into another, basically I just need to put the new image below the old one, then slowly fade out the old one by decreasig its alpha/ energy (alpha and energy are optionally coupled in my mini-framework, i.e. when I set sprite.alphaChangesWithEnergy = true and sprite.energySpeed = -1, then the sprite will slowly disappear and be removed when its energy hits zero, upon which all associated children are automatically removed too).

* http://itunes.apple.com/us/app/color-sound-machine/id454783374

**Not sure if spritesheets + transitions would support that for physics objects otherwise

I'm happy seeing some people are interested in this details.
I can't imagine sprite sheets would help a lot but maybe... have to check it out...

My first tries was likewise: a parent physical object and 1-2 additional layers for decoration.
It worked with pivot joints, but not as perfect as I wanted. This way I tried to avoid the maybe slower or CPU cost higher Lua based position correction.

The effect you want to achieve can only be done in Corona with extra images reassembling the shadows and reflections. To have less impact on the performance, sprite sheets wil help alot as every texture switch is a state change in OpenGL and takes time. The best results you will get whne you are able to use just one texture for the game play. Or try to group images so at least inside a group you won't see texture changes.

views:1573 update:2011/10/5 8:48:05
corona forums © 2003-2011