Isometric shadow mapping

Started by
32 comments, last by O-san 15 years, 11 months ago
Quote:Original post by O-san
Thank you! Well... there really isn't much difference except I render my objects from 2D images instead of real 3D objects. The under laying engine of the isometric graphics shown above is an ordinary 3D engine. The difference lays in how I map my textures onto the objects.

I can draw all my isometric objects in an ordinary painting program; the detail level is not restricted by polygon count. For example this pillar can be drawn in Photoshop and rendered in game using 6 triangles; this speed up the manufacturing time of resources and uses fewer polygons than a real 3D object would... which results in faster frame rate. And yes, I also like the graphical style of isometric engines.


Ah I understand now, I first thought your engine was fully 2D. I also read some of your earlier posts about it and I now see how you are doing it and it seems to be very clever method.

Quote:Original post by O-san
Another benefit of using 3D hardware is that the objects can be rendered without sorting them back to front and I also don’t need to cut them for the sorting to work. This was actually the main purpose why I switched from 2D to 3D. The development of a multi depth isometric engine can be a real headache without 3D hardware.


Yeah, I actually have some experience in that area and definately see the benefits of using 3D hardware, though implementing it like in your project doesnt seem to be very easy either.

Here is pretty old picture of my 2D isometric engine with non-hardware-accelerated per tile lighting (without actual object shadows) for reference. [smile]
Advertisement
I kinda like what you've done here, but I got some constructive criticism for you. It looks like it was done painting the world white where the light is. In life that isn't how it works, and I can help you with that, but it gets kinda tricky. At least it will be in your particular case.

I found that if I rendered the world to a render target, and then multi-textured it with an alpha map, then rendered the target over the map with shadow or night colors that I could achieve more realistic lighting. It really looks like light is hitting the ground and objects instead of straight white.

Using straight white on any 3D object in your world will make it appear that it has some refectiveness, but not everything in the world is gonna reflect light directly back at the user's eye.

All I can say is use multi-texturing and a render target to achieve the most realistic results. I could maintain good FPS even while using this method. However, it is still a good hit, but if you consider the results you will totally think it is worth it.

Now, you don't have to render target the objects themselves, but rather multi-texture them with an alpha texture, and perhaps more, and messing around with the texture coordinates you can achieve similar results. Remember to render the object as a dark color, and apply the multi-textured object over it. My main world is tiled, so the easiest way to get the light realistically on the screen was to use the render target for the base tiles.

That is the method I used. Try it! You will be pleased with the results. ;p
Thanks for the replies!

Quote:Original post by Wrath
Yeah, I actually have some experience in that area and definately see the benefits of using 3D hardware, though implementing it like in your project doesnt seem to be very easy either.


Don't know if I think it is that hard, but It sure isn't easy. Developing an algorithm that handle dynamic lighting and multilevel sorting with large objects is complicated by default in my book. In 2D it can be pretty complex too... if not even more complex (I've tried it). This was actually the easiest solution I could come up with.

Your screenshot looks pretty impressive; I like how you have set up the lighting. The character looks like the police force in Counter Strike :)


Quote:Original post by BEHOLDER192875
I kinda like what you've done here, but I got some constructive criticism for you. It looks like it was done painting the world white where the light is.


The lighting is calculated by OpenGL, the above screenshots with GLSL emulating fixed function lighting. The light color is white in the previous screenshots but I am able to change the color and intensity of any light. An example showing a colored point light:



I could remove the white part altogether, either by removing the specular component in the material or by setting the lights specular color to black. Both would achieve the same result. Sorry for the late reply, thanks for the response. :)
In your engine, what would happen if you had two lights that overlapped?

Also, it would be really cool if your 3D objects/walls could cast shadows in respect to your lights.
looks great!! Love the lighting!

I always had the lighting in my engine tile based which made it look pretty angular...this is great work! well done!
Wow... that looks extremely awesome. Wish I had the skills to do all that. But I definitely haven't gotten that far yet. I'm still in the beginning stages of just learning programming.

But as soon as I do learn enough to make an original game, (if it ever happens) then an Isometric game would be the first I'd do.

Very very pretty though.
The point lights can overlap each other without problem, but the more lights that are visible the lower the frame rate will drop. Here is an example with 4 lights overlapping.

It is possible to add shadows to the point lights as well but the geometry is not accessible in all angles and the shadows would look a bit strange (they are 2D images after all). I have there fore not bothered to implement it.

Thanks for the positive feedback!
Very cool! It looks good. Too bad about the serious frame rate hit though. I get about a 22- ~30 frame rate hit per light, but it really depends on your system. When dealing with roughly 780 FPS a small hit like that is negligible.

You can cast realistic-like shadows from the 2D images, but it would require either ray-casting (which would make a serious frame rate hit on any system), or you can use 3D projections and fill. You could even make the tree shadow rotate around its center and it would still be good. It doesn't have to be absolutely realistic, and it's not likely anyone is gonna notice small variations. I mean us as serious programmers might notice, but we have a trained eye. The more realism you can obtain the better, but weigh the options, and definitely use quick techniques whenever it is possible.
Okay, first off, my OpenGL and 3d in general is not top notch, and perhaps I'm outta my league...

But, it seems to me, that certain objects could benefit from being rotated toward the light prior to shadow projection, such as the trees. This would, of course, be a case-by-case thing(per object setting), and I'm not sure it's actually possible... I think it could be used to reduce distortion on certain shadows, though.

Well, it's an idea.
Hello!

Yes, I have considered bill boarding the objects in the light rendering pass but haven’t had time to implement it. I too think it will remove some distortion but I’m not sure it will look OK in other respects though. I'm worried that the shadows might get a bad alignment with the world objects. The base of the tree for example; it might not begin casting its shadow from the trunk if the trunk is slightly offset in proportion to the rest of the tree. But it could be worth having a look into nevertheless.

Thanks for the reply!

Quote:Original post by ConceptualGeneticist
Okay, first off, my OpenGL and 3d in general is not top notch, and perhaps I'm outta my league...

But, it seems to me, that certain objects could benefit from being rotated toward the light prior to shadow projection, such as the trees. This would, of course, be a case-by-case thing(per object setting), and I'm not sure it's actually possible... I think it could be used to reduce distortion on certain shadows, though.

Well, it's an idea.


This topic is closed to new replies.

Advertisement