These forums are CLOSED. Please visit the new forums HERE
First Look feature suggestion: Lenses |
|
|
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
|
02-05-2007 22:56
We have mirrors in First Look, might as well have lenses too.
_____________________
-
So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them. I can be found on the web by searching for "SuezanneC Baskerville", or go to http://www.google.com/profiles/suezanne - http://lindenlab.tribe.net/ created on 11/19/03. Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard, Robin, and Ryan - |
|
Logan Bauer
Inept Adept
Join date: 13 Jun 2004
Posts: 2,237
|
02-05-2007 23:45
Lenses as in, "Give us shiny and transparent at the same time so we can make glass/ect", or a new texture setting to make looking through it magnify/shrink the area behind it? I'd happily take either.
|
|
Jeff Kelley
Registered User
Join date: 8 Nov 2006
Posts: 223
|
02-06-2007 10:05
Whay you are asking for is ray-tracing. No personal computer will support it in real time.
|
|
Scalar Tardis
SL Scientist/Engineer
Join date: 5 Nov 2005
Posts: 249
|
02-06-2007 12:03
No it's not necessarily ray-tracing. Instead it is distortion of meshes within their own renderspace that is masked onto the lens. It can be done very easily using the same technique for simulating a mirror.
With a mirror, take the scene in front of the mirror and duplicate it behind the mirror in reverse, with the mirror itself being a viewport into the reverse-space. To determine what objects are included in this reverse-space, trace only the light rays for each corner of the mirrored surface, and extrapolate a cutting-line along the traced corners that limits the number of objects in the reverse space. [img=http://img489.imageshack.us/img489/4829/mirrorsimulationoj4.th.jpg] A lens works very much the same way, except that objects in the virtual-space behind the lens are warped in order to "unfold" the lens rays back into a straight line projecting out behind the lens. This virtual-space view is then rendered normally as if the lens was just a hole looking into this other renderspace. [img=http://img489.imageshack.us/img489/7042/lenssimulationjg1.th.jpg] For a simple uniform lens view to be correct, the object vertexes are adjusted along a graduated distortion from the undistorted centerpoint of the lens. The distortion field is a gradient from the center point to edge of view, and so allows for simple vertex distortion calculations. [img=http://img489.imageshack.us/img489/981/lensgradientre0.th.png] So no need to raytrace. Instead it can be done using a method similar to how mirrors work, except with vertex distortion instead of reflection. . |
|
Draco18s Majestic
Registered User
Join date: 19 Sep 2005
Posts: 2,744
|
02-06-2007 14:42
Rendering the "reverse" space for a mirror is expensive as well. One mirror reflecting three prims adds three prims to the render set. 20 mirrors reflecting 3 prims (say the same 3) adds, count them, 60 prims to the render set.
That's how to cheapo-render flat mirrors traditionally (ie no raytracing). Curved mirrors increase the number of visually reflected prims dramatically, each one taking up fewer and fewer pixels. What SL has now is merely rendering the scene twice, regardless of the number of mirrors and then stretching and skewing the image onto the surface. I Suggest that if we do refraction, we do it in the same fassion, using a different set of distortion tools. Concave surfaces would have more visible in them than a flat prism, and a convex has less. If we use the main render, we can magnify it fora convex lense and shrink it for the concave (possibly using a larger image than the normal viewer frutsum, which can be cropped for the normal view). If the lense isn't parallel to the camera, just do what we do for mirrors: stretch the image non-proportioanlly. |
|
grumble Loudon
A Little bit a lion
Join date: 30 Nov 2005
Posts: 612
|
02-07-2007 08:32
Given the issues with expanding the Object structure, I would think a hard coded Texture key would work.
Then the Image repeats would allow you to set the X and Y scale. |
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
02-07-2007 17:24
They seem to have given up having two cameras, now, and so they may be rendering it only once.
|