r_mirroralpha models?

Discuss the creation of various model formats for Quake engines, and related matters to modeling.
Post Reply
behind_you
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

r_mirroralpha models?

Post by behind_you »

question of curisosity mostly. im wondering of this has been done or is simple to implement. i read somewhere that you can only apply mirroralpha to surrounding brushes.

for those who dont know what im talking about, mirroralpha makes a brush transparent and reflects stuff. like a mirror.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Post by leileilol »

and what? Render an entire scene per polygon on a model?

And that's why it's never done.
i should not be here
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Post by mh »

No no no no no.

http://www.team5150.com/~andrew/carmack ... rview.html
Glquake has shadows and mirrors, but those are novelty features and not rigorously implemented. The game wasn't designed around them, and we won't exploit them.
First of all fix r_mirroralpha to make it work right. Do a proper generalised implementation of it. Then start thinking about doing sexy things with it. In that order.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
behind_you
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Post by behind_you »

i c. possible i guess. is what i said about only surrounding brushes in a world could become mirrors true?
mankrip
Posts: 924
Joined: Fri Jul 04, 2008 3:02 am

Post by mankrip »

This is probably the closest you can achieve. Generate an envmap of the current scene, and apply it to the model.

It sounds easy, but should be a pain. I have no idea of the algorithms for that.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

It won't be accurate because an envmap is generated from a single point... (and because regenerating it every frame is kind of dumb, especially if there are multiple mirrors in the scene)

This idea is probably only really feasible with raytracing, at least if you want the mirror-surface to be smooth/curved. Otherwise, if you want faceted reflective models, maybe you could do it if your models are pretty low-poly :P But it wouldn't be useful except as a tech demo.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Post by Spike »

I wonder what happens in Q3 if you have a portal surface on a moving object like a door or something. There's no fundamental reason why you can't have the same in glquake, you'd just have to track the mirror's model matrix properly when generating the reflection matrix and doing the alphaed bit.

If you actually meant on mdls... Urm, yeah, that's not going to work too well. Too many different planes, too many different reflections. I wonder what your framerate would be like...
Post Reply