Simple shadows using a list of objects?

Started by
3 comments, last by n4x0 17 years, 10 months ago
Hi, a friend of mine and I are making a game, we're finishing with the graphic engine, we used a list (template class of the STL, you know) and we'd like to proyect shadows into the terrain... could you tell me an easy way of doing this? Thanks in advance :)
n4x0 -- C++ ProgrammerTank Game - Progress: 2%
Advertisement
Quote:Original post by n4x0
Hi, a friend of mine and I are making a game, we're finishing with the graphic engine, we used a list (template class of the STL, you know) and we'd like to proyect shadows into the terrain... could you tell me an easy way of doing this?

Thanks in advance :)


There is no easy way to do shadowing, however I think the easiest way is using projected textures.

It is a technique of rendering the scene from the light's point of view and then saving the depth values.

Then when you render the real scene the pixel on the monitor is mapped through matrix transformation into uv coordinates and you do a simple check to see if it s shaded.


This is the easiest because it requires no extra coding like extruding triangles and stuff
----------------------------

http://djoubert.co.uk
Thanks, I know shadowing is complex, and not easy, but I wanted to know what is the easiest way of making shadows when having a list of objects. With list of objects this is what I mean:

vector<object*> objects; // List of instances of the class 'object'void DrawObjects(void){   for (vector<object*>::iterator Iter = objects.begin(); Iter != objects.end(); Iter++)       (*Iter)->Draw();}
That's the way I do the drawing... so I wanted to know what are the easiest steps I have to do to make shadows. I guess I've got to include a flag in the object to know if either it proyects a shadow or it recieves the shadow...

Thanks in advance [smile]
n4x0 -- C++ ProgrammerTank Game - Progress: 2%
Depends entirely on the realism of the shadows required and your object class.. If your object class is a bunch of triangles then doing a bruteforce volume shadows will be relatively easy but relatively slow.

I STill think the one mentioned above is the best because it is PROJECT/OBJECT independant and so you add glPrimitives and very complex objects without changing your shading technique
----------------------------

http://djoubert.co.uk
Hi [smile] Thank you.

Actually my object class has just a model (which is an instance of a class that loads the model from an obj-file and contains all the polygons that have to be drawn), a texture, and a Draw function, that's all. So I ask what's the easiest way (I don't mind the realism...) to acomplish that. Something that can be called like... object->DrawShadows(); ... or something like that. What is the easiest type of shadows I can use?
n4x0 -- C++ ProgrammerTank Game - Progress: 2%

This topic is closed to new replies.

Advertisement