Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Wobbo

interesting portal problem....

Recommended Posts

suppose there is a room with a mirror or acurately reflecting surface. now if irc, this is a portal engine, so they probably use reversed portals to the room your in to make the reflectionand make them impassable, so that they act like objects. (quake 3 does this as well)a good example is the bathroom scene, which has only one light.

now suppose the light shines ionto the mirror ( as it does in the video)

does the light from the portal cast light too?

(as in real life?) or is that the same as radiosity too complex etc.? It seems to me that it would be a little simpler that radiosity reflection, because were still dealing with a direct light source - not a streched shinny bump. But then again, this would effectivley DOUBLE the amount of lights in any scene with mirrors. but if you look at the video every scene with a reflecting portal has only one or two lights. also, you already double the polycount, why not the lights too?

/me checks video for more evidence

Share this post


Link to post

As far as I know, yes, mirrors will reflect light as they should. I remember an idder making an offhand comment somewhere that there's a hardcoded limit on how many times light will bounce -- 5 or something -- so that you can't make a room with mirrors on all the walls and crash the game.

Share this post


Link to post

Do you think there will be a cvar to change how many times light bounces?

Light_Bounce # (# being a number 5-15)

Share this post


Link to post

Well, for planar surfaces, adding light reflection would be trivial-- since (as Carmack stated) the basic rendering primitive is a surface light interaction, then you simply add another light, sourced using the reflection vector of the original incident light. It's just another easy projected light-- no problem.

A light reflecting bump-mapped surface is quite a bit more difficult--in essescne we're saying that each pixel on the mirrored object is it's own separate projected light source. There's probably a way to do this in vertex and pixel shaders quite nicely (for Carmack), but I don't know this area of programming very well yet.

Anyway, I'm sure this is the kind of feature that Carmack would try to avoid ("spot effect"), but the level designers would force out of him ;)

Share this post


Link to post
Linguica said:

As far as I know, yes, mirrors will reflect light as they should. I remember an idder making an offhand comment somewhere that there's a hardcoded limit on how many times light will bounce -- 5 or something -- so that you can't make a room with mirrors on all the walls and crash the game.

I remember with Duke3d there was a restriction that you couldnt have two mirrors that would "see" each other: presumably because it would go into an infinite loop when rendering.

Do you think there will be a cvar to change how many times light bounces?

That sounds likely.

Share this post


Link to post

As far as I can tell, light isn't cast from the mirror onto the scene if there is a light in the scene. But I dunno.

I also don't think you will be able to have two mirrors visible to eachother eg: within eachother's line of sight. That would just lag the engine to a lockup.

Share this post


Link to post

i just checked and NO IT DOES NOT. the light has no effect from the mirror, just the REAL one

Share this post


Link to post

in the bathroom scene the mirror casts no light. it would probably look weird anyway

Share this post


Link to post
Xian said:

in the bathroom scene the mirror casts no light. it would probably look weird anyway

like.. a mirror is glowing/lightsource? or what?

Share this post


Link to post

yes, the mirror should cast light if the light shines into it, the engine should still treat light as light even though its just a reversed portal clone (reflection in other words)

its not that big of a deal anyway

Share this post


Link to post
Xian said:

yes, the mirror should cast light if the light shines into it, the engine should still treat light as light even though its just a reversed portal clone (reflection in other words)
its not that big of a deal anyway

I'm not very good at 3D graphics and stuff, but..

original lightsource is a dot and light goes to 360^2 (or 360^3) degrees, right? (probabli 360^3) but when the light is reflecting from mirror then the sum of degrees is much more less depending on angle between lightsource and mirror..

am I correct?

Share this post


Link to post

Probably :) I dont know about how it should react, but it seems nothing changes in the video at all

(and by reversed i just mean mirror reversed, not flipped upside down or inverted- quake 3 does it right

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this  
×