Skip to main content
GameDev.net gamedev.net
🔒 Locked

Lights + Cameras

Started by irishboy Oct 23, 2001 at 9:34 AM 3 replies 400+ views
Original Post
irishboy
irishboy
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.
ChrisE
ChrisE
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)
Author of Power Render (http:/www.powerrender.com)
irishboy
irishboy
sorry - that last post was by me. I forgot to type in my username.
ChrisE
ChrisE
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)
Author of Power Render (http:/www.powerrender.com)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.