Jump to content
  • Advertisement

Archived

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

WhatEver

OpenGL I need help doing envirnmental mapping with OpenGL

This topic is 6935 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

I think that''s what you call it. I want to light up my level like Quake does. How do they do it? I''m using OpenGL''s light routines but it doesn''t have the effect that I wanted. I don''t know how to find the distance from a point to a polygon if that helps you any.

Share this post


Link to post
Share on other sites
Advertisement
Quake uses a technique called "Light Maps" to light it''s levels with amazing accuracy. What light mapping is, is that you pre-light the level and store lighting values in seperate smaller texture maps. Then at run time you blend the polygon of the level with the light map you created before making a very pretty scene. Actually i''m not sure how people are blending the maps together (multi-texturing?!) Well, to create the lightmaps you use a "slow" technique called Radiosity before the game starts. I believe all my info is accurate, but i''m not a Quake guru. Actually I don''t even like Quake. Dont'' flame me for this..Cheers!

Share this post


Link to post
Share on other sites
So you''re saying that at init time it creates a set of texture coordinates for the light maps for every single polygon, scaling the map up and down according to the distance of the light? What about when a wall throws a shadow on the ground? I''ve seen a light map and it''s round.

Share this post


Link to post
Share on other sites
Light maps are the same shape as the polygon you''re going to map it to. You''re getting Lightmapping confused with environment mapping. Environment mapping is where you use a circular texture and map that to an object using a cheap little calculation (please note that this is not real environment mapping). Light mapping is a different process. Either way you can learn about both on the internet. Cheers!

Share this post


Link to post
Share on other sites
Well, since we are talking about lightmaps after all, check out the article on, and named, Real-Time Radiosity here at GameDev.net.
__Just go to "Previously featured articles...." at the bottom of the current articles [on the main page.] It should be under "Programming" with the date "2/19/00."
OR Here's the link : Real-Time Radiosity by Nathan Vegdahl


---Sonic Silicon---

Edited by - SonicSilcion on 4/27/00 12:25:11 PM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Lightmapping is a technique to "draw" lighting, and has not much to do with radiosity, which is an illumination model(more or less), btw quake3 doesnt even use radiosity, but the direct illumination model.

With vertex lighting, as OpenGL has it built-in, you can do per-vertex lighting, and therefore if you have big triangles/polygons this looks not so good.

Lightmapping allows you to do per-texel lighting, and is more accurate.

q3:

The lighting is precomputed when the level is built(the *.bsp files already contain precomputed levels) and when it is rendered, for each polygon/triangle the normal texture is blended with the lightmap (either using multitexturing or multi-pass texturing). Note that lightmaps are low-resolution textures, compared to normal textures because you need for each polygon a !unique! lightmap.

Because lightmapping requires much precomputing its used for static lighting mostly.(you can notice it in q3dm19, on the platform by which you can get to the railgun, the shadows do not change).

-Lev

Share this post


Link to post
Share on other sites
That''s pretty cool.

I still don''t know how to "light map" something . Boo hoo. I guess I''ll skip that part in my game for now.

I need a detailed explanation on how to do "light mapping", or better yet, give me a program made with Visual C++. The program only needs to be a box(room) with the light map aplied to it.

Share this post


Link to post
Share on other sites
Can you outline a lightmap for me. Is it UV coordinates of a single image, or is it UV coordinates for several images?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!