PDA

View Full Version : Tinkering w. a CHROME MAPPING plugin for MAX... useful??


MasterZap
06-27-2002, 02:16 PM
"Chrome Mapping" is a mode used in OpenGL (I think) and definitely on SGI workstations (that I know ;) ) and basically it means that the X and Y coordinates of the normal vector (in screen space) is used to index into a bitmap.

That means that a circular area of the center of the bitmap is used... but it also means that a photo of a sphere maps exactly to a sphere.... and uh.... a picture is more than 1000 words I think.... (see below)

Anyway, I noticed that MAX doesn't have it, and I needed it, so I whipped up a plugin for it. It's kinda rough around the edges and my question is now.... would this be useful to you guys? Should I polish it and make it useful and realease it online? Or does it suck? Or does a better one exist already that I missed :D

Lemme know.

In the below picture the round cork of the bottle is real and the whole background is a photo done w. my crappy digital camera.

Then using the image of the sphere as a "chrome map" I put in another sphere, a teapot, and a box into the scene. Beyond the "chrome map" which comes directly from the very same photo as the one used as background there is NO lighting in this scene (for making light, there is lights to make shadows on the "floor" plane).

/Z

MasterZap
06-27-2002, 02:19 PM
Note that these images are made w. zero-effort:

1. Take a picture
2. Map as background
3. Cut out the sphere object
4. Apply a "chrome map" to my material w. nothing else (in these cases I used 100 self illuminated, used as texture)
5. Add shadows (for taste)
6. Blur equal to my crappy camera (to taste)

Voila. Each image about 2 minutes of work.

Is this useful you think?

In this image the round ball in the middle is really there, the other balls, teapots e.t.c. are added using that ball as a chrome map.

/Z

MasterZap
06-27-2002, 02:21 PM
Of course ideally, the object is uniformly colored. If it has a pattern, as this picture has (the big ball in the middle is really there, the rest is - obviously - added later) it gets less useful on anything but other "spheres"... but still looks nifty:

/Z

OrestesMantra
06-27-2002, 02:34 PM
Wow, thats really cool man.GJ!

Joebount
06-27-2002, 02:53 PM
I must be very tired, but could you explain more, I don't catch it.
please :°)

MasterZap
06-27-2002, 03:12 PM
Okay, step one, get a camera, take a picture of a real-world scene. In this picture you must have a SPHERE made of the material you want to mimic. Or best of all a real CHROME SPHERE which you can then massage to look like anytging you like....

Here is a picture original shot with a camera:

MasterZap
06-27-2002, 03:13 PM
Step 2, drop some 3D objects in the scene using standard tricks to make shadows and blah blah:

(Ugly isnt it? :) )

MasterZap
06-27-2002, 03:14 PM
Now cut out the spherical original object, like this:

MasterZap
06-27-2002, 03:16 PM
Now use my "Chrome Mapping" plugin and drop in this map as - in this case - texture (but can be used as ref. as well) and - in this case - 100% self-illuminating object, no specular, no nothing, and you get THIS

Geddit?

/Z

OrestesMantra
06-27-2002, 03:18 PM
In other words, you can light objects with reflections,etc that perfectly match the *real* object in the picture with little effort.Very cool me thinks:beer:

Joebount
06-27-2002, 03:30 PM
Oh okidoki ! thx!

I got it now
...
I'm very very tired ! :°)

MasterZap
06-27-2002, 04:08 PM
In other words, you can light objects with reflections,etc that perfectly match the *real* object in the picture with little effort.Very cool me thinks

Yes - if you have a reference photo of a spherical object of the right material (or chrome, which you then can tweak together w. the "Normal" light parameters to pretend to be many other forms of lighting)

Of course, you dont need to have the reference object in the actual scene being rendered, I was just being lazy and playing around w. my digital camera :)

Just thought it was fun.

/Z

OrestesMantra
06-27-2002, 04:37 PM
How long did this take you to make?

Pedro
06-27-2002, 04:55 PM
Well, that's just extra spiffy :D

I'd sure like access to some plugin like that - got a download address?

MasterZap
06-27-2002, 05:02 PM
How long did this take you to make?

The plugin?

Oh most of yesterday afternoon....

The pictures?

5 minutes a piece max, heck the hardest part was matching the shadow directoin and ground-plane angle and get the blur level similar to my crappy digital camera ;)

I'd sure like access to some plugin like that - got a download address?

Not yet..... I have a stupid bug in it.... if you use crop in a sub-map, that crop disappears when you re-load the file!?! I dunno why. I would guess it's a max bug, but no other plugin does the same. Hmmmmm..... so I am doing something wrong. Dunno why yet tho ....

/Z

arvid
06-27-2002, 05:05 PM
Nice :) I've been thinking about a similar setup myself, but I would only get half an environment, cuz thats all the info you can get out of such a photo, any way around it? What does that paricular scene look like from another angle?

MasterZap
06-27-2002, 06:14 PM
Yes exactly thats the "drawback"... you only get a half environment. But if you are shooting from a fixed camera position you dont need (much) more... (well it depends, but for simple stuff that stays "fairly centered" in the shot you dont need more)

/Z

damon579
06-27-2002, 06:47 PM
that is just too cool :)

MasterZap
06-27-2002, 08:21 PM
Heres another one

The round thing in the middle is reality (half a pokemon ball stolen from the kids :) ) and the small ball and teapot is mapped w. it...

/Z

MasterZap
06-27-2002, 08:23 PM
And here borrowing a LEGO (no wait, Duplo, the mojo size Lego stuff) part from the kids, using the left "blob" on the duplo part as a map....

/Z

MasterZap
06-27-2002, 08:28 PM
half an environment

I thought about that and its actually not right... you do get all of the enviroment... everything except what is behind the reflective ball... (think about how a sphere *reflects* light)

However the stuff around the edges gets far too low resolution to be useful in any other angle than from the same angle as the original pic was taken. (And my chrome mapping always maps towards the camera anyway)

/Z

halo
06-27-2002, 09:16 PM
i once saw on telly some VR glasses that worked on this technique...

they placed a chrome sphere in the centre of the room, the viewer wore almost normal looking glasses which had just a CG object projected on to the lens in front of the eye and the rest of the eyeglass was clear like reading glasses which still allowed the viewer to see the rest of the room as normal...cameras on the glasses picked up the reflections from the sphere and used this data to light the CG object as above, the texture just as customisable as in 3d apps...as you moved around it mocap data picked up the movement and recalculated the render using the reflection/lighting from the sphere in realtime meaning you were looking at a realistic rendered object in perfectly natural surroundings...:D

i think they were talking about hooking up VR gloves to allow the object to be manipulated, but i havent seen anything more than this since

arvid
06-27-2002, 09:54 PM
Hey, would you do me a favour and use this image with your shader :lightbulb Im interested in how a handdrawn (M.C.Escher) image coaps with this :wip:

Just for fun!

http://home.bip.net/arvid.b/escherrefl.jpg

MasterZap
06-27-2002, 10:05 PM
Voila....

MasterZap
06-27-2002, 10:11 PM
Tweaked a bit... :)

/Z

arvid
06-27-2002, 10:17 PM
hehe thats funny :applause:

now we know what Escher would have seen, had he been holding a chrome teapot instead :p

MasterZap
06-27-2002, 10:23 PM
Indeed :)


Heres a throw-together... note there is NO LIGHTING in this scene other than for the table + shadows.

(And you can tell how the lighting doesnt match between the objects since their chrome maps were snapped in different spots...)


/Z

arvid
06-27-2002, 10:29 PM
Originally posted by Master Zap


I thought about that and its actually not right... you do get all of the enviroment... everything except what is behind the reflective ball... (think about how a sphere *reflects* light)

However the stuff around the edges gets far too low resolution to be useful in any other angle than from the same angle as the original pic was taken. (And my chrome mapping always maps towards the camera anyway)

/Z

I had to do some testing of my own..!
I set up two half spheres, each with a different colour, the one behind the camera is constant red, and the one that the camera is looking toward is blue, but with a gray patch so we can see how much of the background actually reflects into the little 50% reflective sphere in the middle, I hope this sceenshot is fairly selfexplanatory :wip: See the thin gray edge of the little sphere? That's the reflection of the gray patch.

It means you're right, its not half an environment, there's more that can be extracted! :cool: Otherwise it would have been completely red, only reflecting one half of the environment.


http://home.bip.net/arvid.b/spheres.jpg

Bezerker75
06-27-2002, 10:46 PM
Wow that's very niffty indeed! I don't get it though...it's a material that you created or a script that creates a material?:thumbsup:
I would love to play around with something like this!!!You should deffinately refine it....I think it could be very useful...:thumbsup:

Chris
06-27-2002, 11:36 PM
Hell yeah, that sounds really handy! It definately would save having to convert the angular map (the light probe image) to a latitude/longitude format in panotools or HDRshop... Nice work! :)

MasterZap
06-28-2002, 04:38 AM
It means you're right, its not half an environment, there's more that can be extracted

Aren't I always right :D

Think about it like this, draw a circle representing the "top view" of a sphere. Then draw a bunch of horizontal lines hitting the sphere, these are your "camera rays".... now reflect them around the normal vector.... as you approach the edge you'll see you are reflecting more and more *away* from the camera (any ray beyond the 45 degree line will reflect away, any ray within the 45 degree line will reflect back towards the camera).

The only "problem" is, as I said, that most of your environment gets crammed into that circular strip around the edge of the sphere... and hence gets blurred/distorted down to pretty low resolution.

(By the way, it's actually this effect of reflections - that so much of them are bunched up around the "edge" of a sphere - that creates the fresnel effect that we use the Falloff map in reflective materials to simulate... )

...it's a material that you created or a script that creates a material?

Neither - its a mapping plugin. And I wrote it as a pass-through map, i.e. it really only distorts the coordinate system and hands that to a sub-map.... so what you do is you apply my Chrome-map to a slot, and to a slot *in* my Chrome Map you apply a bitmap (or any other map you want to use)

It definately would save having to convert the angular map (the light probe image) to a latitude/longitude format in panotools or HDRshop

Yes I saw that Panotools - which I can recommend, I created THIS (http://www.Master-Zap.com/studio/) in PanoTools, a panorama of my studio :) - can convert a reflection-in-a-sphere to a spherical map... i.e. do exactly what my plugin does, but you have to do it as a pre-process step.

However the ADVANTAGE of panotools method is you get a true spherical map which can then be viewed from another angle.... whereas my plugin only maps towards the camera. (Because I am not actually un-distorting and re-distorting, I am just using the normal vectors X and Y to index the image)

/Z

CGTalk Moderation
01-13-2006, 09:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.