creating environment maps


(heeen) #1

is it possible to create environment maps from screenshots and thus making efficient pseudo-mirrors?


(redfella) #2

Yes, its possible… but why would you want to do it that way? Perhaps using a graphics program like Photoshop would be a better option.

OR you can create a skyportal… Here is a tut on how to do that.

and thus making efficient pseudo-mirrors?

Say what?

:chef:

Edit: cant type.


(chavo_one) #3

I don’t think he’s talking about skyboxes. He’s talking about textures to use with “tcGen environment”. I think SD sort of did what you’re talking about. There’s a texture in sfx that looks like someone looking straight up in a forest. It was used on fueldump, but I can’t remember the name of the file off hand.


(redfella) #4

Who knows… as with other topics from this author, answers are based on personal interpretation of the question.


(heeen) #5

chavo is right about my question, although a similar effect could be used using a skybox at least on planar surfaces.
there’s a map called estatica for q3 that uses that effect and ut2003 uses it on it’s water surface.


(G0-Gerbil) #6

Surely you’d jsut do the usual screenshot grabbing:

/sv_pure 0
/devmap <mapname>

then when it’s loaded

/cg_draw2d 0

and use your usual friendly screengrab button to choose an appropriate picture. Then chop it up into a square, most likely shrink it to 128x128 or 256x256 if you want to be really extravagent, and build a shader using it?

Bear in mind it’ll never really show what you want it to - for a start the ‘reflection’ is calculated only at the vertices, so you can quite often get weird warping (you can minimise this a bit by either using smaller brushes, or including tessSize <???> in the shader script).
Also, looking straight at a ‘reflected’ wall will show only a tiny part of the actual reflected image used.

One idea that occurs to me to get around this might be to set your FOV to something ridiculously high before taking the screenshot, maybe 160 or something.

Basically doing the shader and getting a screenshot between them aren’t hard - getting the RIGHT screenshot might well involve a lot of playing around though. Good luck :slight_smile:


(system) #7

L-0-L

where is /SV_CHEATS 1 ?

/sv_pure 0
/devmap <mapname>
/sv_cheats 1
/cg_draw2d 0


(Wils) #8

You don’t need to set sv_cheats 1.

We made our env maps by noclipping to roughly the middle of the area we wanted to generate the envmap in and looking straight up in a high fov (I used 170, I think).

Depending on the sort of reflection you’re trying to fake, you’ll need to adjust the image in photoshop or paintshop pro or whatever, before saving it as a 128 x 128 tga.


(system) #9

Wils - if i type cg_draw2d 0 i see text - this cheat is protected… :confused:


(heeen) #10

shouldn’t a fov of 360 be used to exactly copy the effect? why is cg_fov not working above 180 even with devmap? i know it worked in q2…
also, what kind of filter did you use on the screenshot, some kind of spherical distortion i guess?


(Wraith2k3) #11

Thats because you’re an asshole.


(G0-Gerbil) #12

Woo I was pretty close with my guesswork then Wils :slight_smile:

Did FOV > 180 really work in the old days? I can imagine it might conceivably work in Quake (software rendering), but <180 would (to my limited understanding) require functionality not supported by OGL - IE you’d have to roll-your-own, either entirely in software, or made up of multiple >180 degree views stitched together?

BTW Sin - I do love the way you publically make yourself look so stupid!
I hope you enjoyed your L-O-L, because trust me, there was a whole lot more aimed straight back at you :slight_smile:


(heeen) #13

quake2 had an software render mode but as far as i remember it worked in opengl, too