View Full Version : live camera projections
Elliotjnewman 07-23-2006, 10:48 AM Hi all,
I was wondering if its at all possible to set-up live projections in maya?
by live, I mean when you project an image onto and object and when you move a vert or a face the projection stays in the same place (like its sliding).
at the moment, the way I understand it it is that maya converts the projection to a texture map based on the UVs, so say if you have an object 10 units by 10 units big, using the whole 0-1 UV space, and another object, say, 2 by 2 maya units big, using only 20% of the 0-1 UV space, both are being projected onto by an image, they will display them at different resolutions. if you set the projection at 128x128 it will tile that size on the Uvs per object, so the bigger object that uses all the uv space will display at the same 128x128 as the smaller object, but becuase its bigger and uses more UV space the 128x128 texture has been stretched accross a bigger area, thus creating a lower res looking projection.
What I would like was if maya just ignored object UV space and just projected the image through the object, I believe lightwave does something like this.
its just frustrating at the moment as I have to reload the image each time I manipulate the geo that its being projected onto...
any ideas? sounds like its something embedded deep in mayas code and there is no easy way around it...
cheers,
Elliot
|
|
pixlix2
07-24-2006, 11:31 AM
Hi,
I hope I understand you correctly.
I've posted about a simliar topic a while ago:
http://forums.cgsociety.org/showthread.php?t=344899
Today I did some new tests and I came up with a workaround. It's really just a cheat and the connections I created there make not much sense. They are only used to force a reload of the textures as soon as the geometry is changed.
http://i33.photobucket.com/albums/d60/pixlix/proj.gif
the multiply-divide node is set to multiplication and the second input is set to 0, so the result will always be zero
Elliotjnewman
07-24-2006, 01:41 PM
hi pixlix2, thanks for the input, but its not really what Im after.
You have understood me, in that I want a live projection, but your method of force refesh will slow me down too much. The problem is that maya applies the projected image onto the geo as a texture map, this is what takes up processor power. try projecting a 2K image onto 200 or so objects and you will see what I mean.
Im sure this is something very hard to change, as its deep within the code of maya, its how it handles texture file nodes. Its silly if you ask me becuase it would be far less cpu intensive for the projection not to be converted to a texture first... :( iIll see if I can can get an example of how lightwave handles it, this may make it clearer if Im still confusing :)
Cheers.
Emil3d
07-25-2006, 03:44 AM
Elliotjnewman, I’m also not sure if I understand exactly what you want. But I’m assuming that at the end you want to move your object/components independently from the texture.
This is easy in Maya, just apply your image As Projection. One way to do that is - in the Attribute Editor, click the map (checker) button to the right of an attribute (in your case - the color), and in the Create Render Node window that opens, select As Projection from the three radial buttons at the top. This will project the texture on the object exactly as a projector in real life and when you move your object/components away from the projection spot the texture will not follow the object. By default the texture projections repeat themselves infinitely in the 3D space in patterns created from the Projection type selected in the projection node. To turn off the repeating, uncheck Wrap in the Effects section of the Projection node, and then the space your texture projection occupies in the 3D world, will be limited to the size of 3D texture manipulator, which you can move, rotate, and scale in any way you like. At the end objects assigned with that texture will show it only if positioned in the space occupied by the 3D texture manipulator.
Have in mind that Texture Projection described above is a completely separate and independent process from the UV map projection that you talked about in your first message. The UV map projections create UV layouts for your object, and result in each UV being attached to a vertex, so that when you move a vertex in a 3D space the texture moves with it unless you assign the texture As Projection.
The result from editing objects with texture projections show correctly when you render the scene, but if you want to do this interactively in the viewport, you have to deal with several issues.
First the interactivity is not available by default and in the viewport the texture will not update the effect of the projection node until you apply a command that affects the projection node itself (for example move and undo the 3D texture manipulator or come up with a solution like Pixlix’s suggestion).
To enable interactivity, choose High Quality Rendering from the Shading menu of your current viewport. The performance here depends entirely on your video card capabilities. I have Fire GL X3 and moving vertices around is kind of sluggish for me. One workaround I found for planer projections is instead of applying texture, to use a spot light with the texture mapped to its color. In the image below the texture is being projected from the spot light on a spherical object that shows in the viewport when High Quality Rendering is enabled.
http://f10.putfile.com/main/7/20423360031.jpg
The good news is that moving objects and verts around updates instantly without any slow downs and is real pleasure to model like that. At the end when modeling is done you can use the light and Look Through Selected command to use it as a camera for the texture projection which gives identical result but instead of a light it will be now a real texture.
I hope this helps.
Elliotjnewman
07-25-2006, 01:44 PM
Emil3d, thanks very much. thats perfect, you have totally understood my question.
I created a spot light as you said and plugged an image into it, very nice, I have a quadro card, not sure which one but it handles it fine in high quality, its a little slower, and some wierdness happens but I can live with it. its cool too when you look through the light it creates a camera which you can adjust the focal length of (which is what I need as I am matching something shot on a 85mm camera.
The one thing I cant seem to do is to get my object totally ambient, like when you create an ambient light and tell it not to shade, when you look at a textured object you are seeing a totally ambient map, with no shading. I have tried to increase the incandesance and the ambient values of the objects shader but this doesnt work.
What I may do is find someone I work with here, and get them to look into altering the way a camera projection works to the way a light projection works.
great stuff.
- Elliot
Emil3d
07-25-2006, 10:39 PM
Hmm, may be it’s your video card, I tried changing the ambient and incandescent color to white and the viewport displayed the changes when High Quality Rendering was selected. Changing the incandescent color is displayed in the viewport even without High Quality Rendering. My system also displayed the effect of added ambient light which has the same effect as the ambient color when the Ambient Shade attribute of the light is 0.
I’m not sure why would you need all this but adding ambience and incandescence however washes out the effect of the light casting the image as shown below.
http://f10.putfile.com/main/7/20514085350.jpg
The first sphere on the left has the image cast from the light and the ambience increased to white. I put the second sphere on the right for color comparison - it has the image applied as texture projection with the ambient changed to white but without any lighting reaching it - which has the same effect as selecting Use No Lights from the Lighting menu of the current viewport.
And since you mentioned using the Focal Length of the camera that is created when using Look Through Selected, here is a tip you my find useful:
The camera created like this is temporary and Maya will delete it if you use the viewport for something else. I usually use the Persp/Outliner layout and drag with the MMB cameras, lights, and objects from the Outliner to the viewport to look through those) To prevent deleting the temporary camera, after creating a light, use Shift + D to make a copy of it and delete the original. Maya will not delete the camera from a copy of a light when you no longer use a viewport to look through it.
CGTalk Moderation
07-25-2006, 10:39 PM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.