Archived

This topic is now archived and is closed to further replies.

Lights + Cameras

This topic is 5897 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I''ve just started in PR4 (trial version). I have a couple of questions. Firstly, how do I incorporate a light in my .pro file? I.e., if I create an object in 3D Studio Max 4, add a light to it, then export the .3ds file to .pro, will the light be included? If so, how do I then get a handle to that light in the code? I guess my second question is the same only for camera''s instead of lights. Thanks.

Share this post


Link to post
Share on other sites
Lights are not stored in .PRO files. However you can use dummy objects and set the light positions to them in your code. Look at the DummyPositions for an example of an animated light using a dummy object.

1 Camera is allowed per .PRO file. It will be loaded and stored in a linked list, and you can get it by calling PR_GetFirstCamera. If you want animated cameras make sure you read the 3DS Keyframing section in the artist''s guide.



Author of Power Render (http:/www.powerrender.com)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Surely this is not a great way to work in production terms. I want to leave all the game design stuff such as light positions,
orientation etc to artists/designers. I don''t want to be responsible for have to recompile code to set up lights.

Is this unavoidable? I guess I could write some sort of tool
that enabled these guys to set up their lights outside of the
game code and then incorporate that data somehow into the game engine???

Could a future release of PR4 store this data in the exporter?

Cheers

Share this post


Link to post
Share on other sites
This depends on what you are using PRO files for. They were originally intended for meshes and not entire levels.

There are several possible lighting schemes:

1)
It is possibe to attach lights to a segment using code. However if you associate lights with a segment the engine will only transform the lights when you transform the entity. This means that any objects you render beforehand will not be affected by those lights. This is why lights are stored in a global list before any objects are rendered.

2)
You can use PRO Edit to apply precalculated RGB lighting to a model. You can also save the lights separately to a file for other uses. This technique was used in the portal example.

3)
You can use Q3Radiant''s lighting for BSP''s and precalculated lightmaps.

Most people will use either 2 or 3, along with 1 directional light for lighting up objects and a number of point lights for flares/weapons.

In short there is no lighting scheme that will suit everyone''s needs, so PR doesn''t use higher level lighting routines. You have to manage them in way that suits your application.




Author of Power Render (http:/www.powerrender.com)

Share this post


Link to post
Share on other sites