Refraction for the magnifying glass?

Chode

Newbie
Joined
Oct 11, 2003
Messages
155
Reaction score
0
In the e3 movie, the scene in the lab with the scientist and Alyx shows a magnifying glass. It appears to be magnifying the scientist's hands typing on a keyboard.

Looking again at this movie, I am wondering if true refraction was used to create a magnifying lens, or if it was "cheated" (term used loosely, please don't flame me).

By "cheated" I mean an invisible camera sitting about 20 centimeters (around 8 inches) behind the glass, and the glass of the magnifying lens just displaying what the camera sees.

If they did "cheat" this, then I don't consider it a bad thing. I'd consider it a good resource saver.



But if it isn't "cheated", then I theorise a weapon mod for a sniper rifle where the scope is fully functional: this means that when you click zoom, the camera moves to behind the scope and looks through it, using true refraction to calculate the zoomed in view.
 
thats a good question. im not quite sure, im thinking its maybe just a glass see through texture with maybe some zoom style function applied to it. (like a sniper zoom)

im just guessing here so dont flame me :cheers:
 
I don't think that a refraction function would be impossible to code. There are loads of games that appear to have refraction effects (Metroid Prime springs to mind). It's just another warping effect, such as the effect seen when the Strider fires it's beam thingy. Even humble ol' Windows 98 has a magnifying lense screensaver that runs like a whippet with a bumful of dynamite.:E

Seeya.
 
Either effect would still be possible for a fully functional sniper rifle. (Remember in the same demo the camera and how it moves also displays the image in real time.)
 
It seems to be a 'proper' magnifying lens and whichever way you look it magnifies what u see real time. Whatever its cool :cheese:
 
The magnifying glass displays the correct image at the correct angles, even when looking through the other side of it.

This would point to refraction.
 
i dought that it would be cheated, that would be kinda a let down, i think people think this game is like a new revolution or somthing!
 
If you just think a bit abotu the tech demo at E3, when they show off those *materials* hanging from the ceiling. Man There is a lot of effect going on right then and I don't think they used a camera to pull it off...it's all in the texture ! =)
 
It's probably a refraction, water does it too, so why won't a glass material?

I think it's the first game that does refraction real-time.
 
Ok, apparently the general concensus is that true refraction is going on.

Then my idea for a weapon mod is a reality: A genuine scope on a rifle instead of just some full screen sprites. Hmmm, ok....the code would need to be something like on alternate fire, reposition the camera to the location of the scope on the rifle. Might have to set up some controls to handle zoom and focus..... it's a possibility.

I'm on fire. Two good ideas in as many threads :cheese:
 
yeah it sorta seems to do both... if u place an object directly under it, it also shows that sorta like a mirror its rather F*cked up but i wont post ss for rather obvious reasons
 
Originally posted by Chode
Ok, apparently the general concensus is that true refraction is going on.

Then my idea for a weapon mod is a reality: A genuine scope on a rifle instead of just some full screen sprites. Hmmm, ok....the code would need to be something like on alternate fire, reposition the camera to the location of the scope on the rifle. Might have to set up some controls to handle zoom and focus..... it's a possibility.

I'm on fire. Two good ideas in as many threads :cheese:

I don't think that's possible, because for real time refraction you have to leave a bit of detail out, the refraction is lower res than the surroundings. So when you use it as a scope it's probably a bit blurry because of the lower resolution.
 
It's not real refraction. It's a shader that magnifies slightly, whats viewed through it. Maybe also adds a fisheye appearance to it, but its not true refraction. When the game comes out shine your flashlight through it, if it was true refraction it would bend the light from the flashlight to create a smaller yet brighter spot. It looks good and thats all that matters. It would be a huge waste of cpu power doing true refraction, there's no call for it in a game as all its effects can be faked eg: a refracted lens that could use the light from the sun to create a bright spot of light to burn enemies, why do that for real when faked works just as good. Telescopes use lenses, but you don't need them in a game to have Telescopic view. If Valve did create real refractive surfaces I'd actually be annoyed, it would be time and effort wasted on something that just wouldn't need that level of realism when faking it does just as good a job for whats needed
 
No it's probably real refraction, it's possible to make refraction without all the caustics like you described (breaking of actual lightbeams from a flashlight). You can make a refractive material in a program like 3DsMax without these caustics, but the image IS refracted. Until you add something like the Photon maps from Brazil, you will not see the breaking of light like a flashlight through a magnifier.

It may not incorporate everything there is to real refraction, but it does show the disturbed image of something refracted through a non flat surface. Like the water for instance.
 
Originally posted by PvtRyan
No it's probably real refraction, it's possible to make refraction without all the caustics like you described (breaking of actual lightbeams from a flashlight). You can make a refractive material in a program like 3DsMax without these caustics, but the image IS refracted. Until you add something like the Photon maps from Brazil, you will not see the breaking of light like a flashlight through a magnifier.

It may not incorporate everything there is to real refraction, but it does show the disturbed image of something refracted through a non flat surface. Like the water for instance.

the 3D Max renderer, as with all other renderers in XSI, Maya, Houdini, Lightwave etc. are pre-calculated and not realtime.

I try not use Max if I can help it because the packaged renderer its had for ages isn't a true full renderer. It's scanline and doesn't behave the same as the others, it has issues with reflections too. Brazil (and I think Final Render) are full renderers that trace individual beams of light correctly. Though again, I don't use Max stuff if I can help it, but its a fact the default Max render isn't very good technically.

But even in Lightwave, create a true refractive surface, point a light through it and you'll get the bending of the light beams through the refractive material correctly, and thats out of the box with no additional plugins or renderers (it can't even use external ones, poor LW users :(). Though it doesn't currently have volumetric caustics (so you only see the effects on a surface and not through atmospheric effects themselves like though fog or smoke)

Mental Ray (XSI, Maya and I think now Max) also does this, though Mental Ray can be faked in a way to have volumetric caustics. I believe final Render can do them aswell

But seriously, I find it difficult to believe its a genuine refraction. It would be as pointless as creating the entire skeleton, texturing it, adding accurate and realistic muscles, flowing blood and sweat glands to character models when you can fake it much easier and still get the result you want.. Maybe one day it'll be the norm in realtime engines, but right now its just over the top and not needed
 
Its real refraction. Later in the e3 videos (the last one of city 17) you see the strider shoot it's super cannon thing, and an awesome refraction effect takes place, and an even more complex one than a simple magnifying glass.
 
Originally posted by tehsolace
Its real refraction. Later in the e3 videos (the last one of city 17) you see the strider shoot it's super cannon thing, and an awesome refraction effect takes place, and an even more complex one than a simple magnifying glass.

Again, that is _not_ real refraction. It's an approximation, a trick, all done with mirrors, call it what you want, it looks cool I entirely agree, but it ain't real. Photoshop have filters that do that, their not real neither. Its a trick of the shaders that give the impression of refraction. but its not real.

you can fake the appearance of refraction by using bump maps aswell. Things like heatwaves and such, it looks like its distorting the image, and it is, but its not true refraction thats going on.

Guys I've absolutely no reason to make this stuff up. I'm just saying its not real. Hey if Gabe can come in here and prove me wrong then I'll shut up :). But I'm convinced that while it is an incredibly cool effect to finally see in a real time engine. It's just not true refraction, there's no reason for Valve to use true refraction, it would slow things down too much for very little reason. It's a shader thats been told to magnify and distort what can be seen through it. Just like other shaders have instructions to reflect whats around them at any given point for a set number of recursions before it stops reflecting (otherwise it would be an infinite reflection and that would be both overkill and very likely crash any machine trying to do it. The same principals as masking an area in Photoshop and giving it a distortion effect. It looks good, it looks refracted, it does the job, but its not real.

Do the following test. Look at objects in water in the E3 vids, look for bits where an object is half in and half out of the water. Then get a glass, fill it half way and put a straw or something in it, then look at the differences. The shaders can fake it to a point but not offer full true refraction

Now I may be wrong about the last bit.. the water may fake the position, size and appearance of things below the water compared to their position above the water, I haven't seen it though. I just find it hard to believe they are using real refraction is all.
 
Somebody e-Mail Gabe. *He* can set things straight. If he can be buggered to.:E
 
Originally posted by Brian Damage
Somebody e-Mail Gabe. *He* can set things straight. If he can be buggered to.:E

lol!


or better yet, the guy(s) who wrote the particular shaders in question. Maybe get them in here to explain it so the mods can check its really them and not someone who thinks its real refraction pretending :D
 
yeh i have to agree, realtime refraction would eat up cpu power, inless its a very well integrated DX9 shader, but then again that prolly would mean only the 9600 + 9800's would only be able to run them well, reflection/refraction is a pretty consuming process, and in realtime I could only guess it would be more so.

It would be easier to get a 'faked' version of it running faster and on more cpu/gpu's, inless valve is attempting to emulate true physics, though I dont think games are up to that quite yet. Also the E3 demo, was a good chunk away from gold time (lets hope its not that far away anymore) so we have yet to see what the final product is capable of.. maybe it uses true emulated refraction for DX9 compliant, and 'falsified' refraction for anything other, only time will tell... or gabe could!
 
Originally posted by Fenric1138
Again, that is _not_ real refraction. It's an approximation, a trick, all done with mirrors, call it what you want, it looks cool I entirely agree, but it ain't real. Photoshop have filters that do that, their not real neither. Its a trick of the shaders that give the impression of refraction. but its not real.

you can fake the appearance of refraction by using bump maps aswell. Things like heatwaves and such, it looks like its distorting the image, and it is, but its not true refraction thats going on.

Guys I've absolutely no reason to make this stuff up. I'm just saying its not real. Hey if Gabe can come in here and prove me wrong then I'll shut up :). But I'm convinced that while it is an incredibly cool effect to finally see in a real time engine. It's just not true refraction, there's no reason for Valve to use true refraction, it would slow things down too much for very little reason. It's a shader thats been told to magnify and distort what can be seen through it. Just like other shaders have instructions to reflect whats around them at any given point for a set number of recursions before it stops reflecting (otherwise it would be an infinite reflection and that would be both overkill and very likely crash any machine trying to do it. The same principals as masking an area in Photoshop and giving it a distortion effect. It looks good, it looks refracted, it does the job, but its not real.

Do the following test. Look at objects in water in the E3 vids, look for bits where an object is half in and half out of the water. Then get a glass, fill it half way and put a straw or something in it, then look at the differences. The shaders can fake it to a point but not offer full true refraction

Now I may be wrong about the last bit.. the water may fake the position, size and appearance of things below the water compared to their position above the water, I haven't seen it though. I just find it hard to believe they are using real refraction is all.

well...however they do it, it gives a perfect result of refraction, both in the water, and in any effects they use it for.
 
Another thing. for it to produce true refraction the surface has to be lens shaped or curved in some way, which means more polygons. And I have it on good authority its either flat or curved very little

secondly watch the E3 lab vid. The way the image in the lens moves out of synch when the player rotates on the spot, not moves but rotates. A true lens just wouldn't do this, it would change its view on movement not rotation, unless you rotated the lens itself

Thirdly There is also no central bulge or pin. And it doesn't seem to be magnifying either more the opposite. A real lense would need to be concave for it to do that. like a demagnifier

It looks neat, the effect is really cool I wont argue with that, but it just ain't a true lens, sorry guys... Look on the bright side, Valve prefered to give the fans better frame rates instead of wasting time doing something that would ultimately make things crawl and for what, something that will look cool the first few times you see it and after that just be part of the game and nothing special. Tis a good thing ya know :)
 
If it is true refraction, how long do you think it'll be before we see someone creating levels with magnifying glasses outside in the sun, trying to burn ants on the sidewalk ;)
 
Originally posted by RblDiver
If it is true refraction, how long do you think it'll be before we see someone creating levels with magnifying glasses outside in the sun, trying to burn ants on the sidewalk ;)


well IF;) its true refraction... two minutes after people get bored playing with physics I expect :)
 
Dunno about that, he didn't answer the e-Mail *I* sent him.

It was really nice too. I sounded like a hyperactive fanboy and asked him something like 18 questions.:E
 
Wonder if you hold a magnifying glass away from your face, if the world turns upside down in it... ?
 
You must not have focused it correctly...

... and something like a normal map or heightmap could be used instead of an actual curved surface to calculate the refraction.
 
No need to email Gabe - the answer is it's a shader effect. Anyone thinking that it's a realtime simulation of distorted light is wrong.
 
Originally posted by OCybrManO
[B}... and something like a normal map or heightmap could be used instead of an actual curved surface to calculate the refraction. [/B]

Actually, come to think of it, there was something along those lines in the PC GAMER preview of HL2. They said that the engine uses a something-or-other map to mimic the effect of refraction in water. Or something like that.
 
gabe answers all my emails, example...

Chris is the best person to talk to.

I haven't seen Finding Nemo yet. Cabin Fever was so-so (it was more fun than 28 Days Later). I'm seeing Kill Bill tomorrow night.



--------------------------------------------------------------------------------
From: azz0r [mailto:[email protected]]
Sent: Tuesday, October 14, 2003 2:32 PM
To: Gabe Newell
Subject: The state of the planet


Hello there Mr.gabe(gotta love BBC reporting),

I am going to be making a modification for Half Life 2 and wondered a few things.
Will VAC be in HL2? If so will it work for all modifications released (namely big modifications)...
I know you get this question a lot, but please just confirm or deny; this year, next year?
Do you get time to go to the movies? If you did what would you want to see more;
Finding nemo - Cabin fever - Kill Bill
--- azz0r, modDB.com.
 
Well he didn't answer mine...

<crying>

Ohhh... I was so excited about having found out his e-Mail, too!

Does anyone know if theres right way to talk to the guy?

I promise not to play the nerdy fanboy part again!

<sniffle>








:E
 
Originally posted by FictiousWill
No need to email Gabe - the answer is it's a shader effect. Anyone thinking that it's a realtime simulation of distorted light is wrong.

Good luck trying to convince them mate, I've given up lol
 
It's definitely a shader. A very well done shader, but still just a shader. In fact the shader code for it is in the leaked source code.

I would like to see how it'll look on DX7 and DX6 cards.
 
A couple of people that have GF4s have said that the magnifying glass worked for them... though I haven't seen any hard proof.
 
Back
Top