PDA

View Full Version : mip_binaryproxy usage?


ghostlake114
03-13-2008, 11:27 AM
Anyone has success use this shader please share. This shader seems a life saver for displacement . I encounter error when trying use it.

MasterZap
03-13-2008, 02:24 PM
What error is this?

One tricky thing when using it in Maya is that the src geometry MUST have been created earlier in the scene than the geometry onto which you apply mip_binaryproxy as geometry shader. It's a because an earlier Maya entity cannot reffer to a later one, at least not correctly.

/Z

ghostlake114
03-13-2008, 06:06 PM
I have an object and want to write it into .mi to read later by mip_binaryproxy, so this is my steps

1. connect mip_binaryproxy to geo shader of a object, for example shape1
2. turn on write mode
3. enter the file name here: example.mi
4. enter the name of object shape node need to be write to .mi , for example shape2, I also try with transform node but fail too

render, and I get error about mentalray encouter severe error, so what I am wrong?

MasterZap
03-14-2008, 10:08 AM
It expects the instance, not the objec.

In maya speak I guess this mean it wants the "transform" not the "shape"....

/Z

Saturn
03-14-2008, 10:21 AM
by the way what is the concept behind binaryproxies and assemblies in the new mr ?

Eshta
03-14-2008, 08:18 PM
is there any documintation on this subject
even for the MAX world

Robbert
05-20-2008, 01:29 PM
MasterZap, could you give more info / examples please?

DavidLessel
05-21-2008, 09:00 AM
It is working, do as follows:

execute createNode "mip_binaryproxy"
This is a geoshader so you should connect it to the geoshader slot of a transform node.
in the "object filename" field type the path of your mi-file i.e. c:\test.mi
enable write
in the "Geometry" field type the name of the transform node of the object you want to bake. (it seems to only work with single meshes i.e. groups of objects doesn't seem to work)
hit render
You should now have an mi file.
disable write.
hide or delete your original mesh.
hit render, the transform node that the geoshader is connected to should now render as the object you have "baked".
Hope this helps :)

Be aware that the nodes have to be created in the correct order like master Z points out....

Robbert
05-21-2008, 09:51 AM
Thanks DavidLessel, it works like a charm!!! This is genius,,, a lifesaver for the project that I'm now working on (highly displaced mountains)

kjaft
05-21-2008, 02:07 PM
Cool thing! Hope this is gonna be developed further. I'm asking myself why it ain't working using locators or empty groups as placeholders.

acidream
05-22-2008, 08:44 PM
i've been experimenting with this as a way to have lots of trees in a scene while keeping the scene light and effiecient and it seems to be promising. Im curious about the memory usage benefits though. I made a test scene with a paintfx tree converted to polys and got it working correctly with the proxy node and duplicated several hundred proxy objects around the scene. The final triangle count of the scene was equivalent to a single tree, but the memory usage didn't appear to be much better then if i was using actual geometry. Shouldn't it only have to load the object into memory once? maybe there are other contributing factors that im overlooking, but i was expecting a lot lower memory usage.

Nick2970
05-23-2008, 04:46 AM
When I enter the mel
createNode "mip_binaryproxy" I get an error 'unknown node', and nothing is created. I can create any of the other hidden mip nodes this way.

Not sure what is going wrong, Maya 2008 ext2

Any ideas?

Cheers, Nick

DavidLessel
05-23-2008, 10:43 AM
When I enter the mel
createNode "mip_binaryproxy" I get an error 'unknown node', and nothing is created. I can create any of the other hidden mip nodes this way.

Not sure what is going wrong, Maya 2008 ext2

Any ideas?

Cheers, Nick

That sounds odd it works fine for me on maya 2008 ext2, are you on windows? Maybe it's not included in the OSX/LNX builds?

nojjy
05-23-2008, 04:07 PM
Make sure mental ray is loaded before you run this command.

When I enter the mel
createNode "mip_binaryproxy" I get an error 'unknown node', and nothing is created. I can create any of the other hidden mip nodes this way.

Not sure what is going wrong, Maya 2008 ext2

Any ideas?

Cheers, Nick

Bitter
05-23-2008, 09:19 PM
// Warning: (Mayatomr.Custom) : mip_binaryproxy1: reference to invalid instance, ignored //

Despite connecting it to the transform node, this is the error I get.

Ash-Man
05-24-2008, 05:24 AM
// Warning: (Mayatomr.Custom) : mip_binaryproxy1: reference to invalid instance, ignored //

Despite connecting it to the transform node, this is the error I get.


If you do a render view > you will get that error
try batch render

Also check if the mi file gets created or not

Eshta
05-24-2008, 06:46 AM
Here is my file
What did I do wrong ?
thanks

ctrl.studio
05-24-2008, 02:46 PM
I didn't try this thing but take care that at least until maya8.5, - the 'geometry' keyword in a shader declaration was not parsed correctly thus any geoshader that uses that kind of parameter type will not work. those that comes with mib.. will really crash maya as they do not check for a valid 'tag', and as maya is passing just nothing.. you'll have a classic 'attempt to access null DB tag', before crashing.

max

Bitter
05-24-2008, 08:06 PM
Fair enough, it works now. Thanks, I didn't know you had to batch it. :blush:

Ok, so. . .I know assemblies require the correct bounding box. I assume this doesn't care, it gets loaded at rendertime regardless (reads the file, brings in the bounding box, etc) However, I can see the render load the geometry only when it gets near instead of at the beginning of the frame. I moved it to the far corner and it wasn't loaded until 50% of the render was completed.

API 0.11 info : mip_binaryproxy: Loading _0@9:650::obj (http://forums.cgsociety.org/_0@9:650::obj) from D:\test.mi...
JOB 0.8 progr: 50.3% rendered on fs4110ins.8
API 0.11 info : mip_binaryproxy: Loading 194500 bytes geometry.
API 0.11 progr: mip_binaryproxy: 194500 bytes loaded successfully.

No matter the size of the proxy object, it loads at the same time during the frame if the location is the same. So other than keeping my workspace light, does this have a better implication for memory usage? Easier to offload the object?

And lastly, since there are no docs yet, what about flags? What do those mean for this?

Inquiring minds want to know. :bounce:

Ash-Man
05-25-2008, 06:36 AM
Here is my file
What did I do wrong ?
thanks

I think you got them the otherway around
read the post by david again...

Nick2970
05-25-2008, 12:39 PM
interesting, we are running 6 seats of Maya 2008 ext2 on windows. All give the same message when entering the mel, 'unknown node'

Mental Ray is of course loaded at the time.

I will continue trying this as it seems strange no-one else has this problem.

Thanks for the responses

Nick

DavidLessel
05-25-2008, 02:14 PM
interesting, we are running 6 seats of Maya 2008 ext2 on windows. All give the same message when entering the mel, 'unknown node'

Mental Ray is of course loaded at the time.

I will continue trying this as it seems strange no-one else has this problem.

Thanks for the responses

Nick

That is odd indeed, try this:

Window -> rendering editors -> mental ray -> shader manager

you should have a production.mi entry listed there, if I press the "I" icon I get a list of shaders included in the production.mi file, and at the bottom I have mip_binaryproxy listed... Do you have that as well ? (look at my screengrab...)

Nick2970
05-26-2008, 12:25 AM
Thanks David, very interesting, it seems I don't have this shader listed in my production shaders.

I am not sure why it is not there, as all of the others are.

Most strange

Cheers, Nick

Bitter
05-26-2008, 12:50 AM
Hmm, check the installation, it came with SP1 and Patch 4 and 5. (P04 and 05 were before SP1)

Nick2970
05-26-2008, 01:05 AM
From memory, I skipped sp1 and went straight to EXT2, I think that may be the problem

Cheers, Nick

Jozvex
05-26-2008, 03:36 AM
Yes the Service Pack and the Extensions are different things. The Extensions are like extra plugins while the Service Pack is a true upgrade to Maya.

Nick2970
05-26-2008, 04:53 AM
Yeah that was definitely it, although I cannot install ext2 over service pack one for some reason.

I need ext2 as it has the latest Mental Ray, I grabbed the production .mi and .dll from the install of sp1, and dumped them into ext2.

This lets me use the binary proxy node, but I get an error when trying to render out the mi file from the proxy node.

I will keep exploring trying to figure out why ext2 will not write over sp1, it tells me sp1 is in use, even though i have it closed and nothing is showing up in windows processes

any idea?

Cheers, Nick

DavidLessel
05-26-2008, 05:10 AM
unfortunately you need to uninstall any maya 2008 versions if you want to install maya 2008 sp2...

Ash-Man
05-26-2008, 05:16 PM
you might want to look into this
http://forums.cgsociety.org/showthread.php?f=87&t=541718

Kel Solaar
05-27-2008, 04:51 PM
It is working, do as follows:



execute createNode "mip_binaryproxy"
This is a geoshader so you should connect it to the geoshader slot of a transform node.
in the "object filename" field type the path of your mi-file i.e. c:\test.mi
enable write
in the "Geometry" field type the name of the transform node of the object you want to bake. (it seems to only work with single meshes i.e. groups of objects doesn't seem to work)
hit render
You should now have an mi file.
disable write.
hide or delete your original mesh.
hit render, the transform node that the geoshader is connected to should now render as the object you have "baked".
Hope this helps :)

Be aware that the nodes have to be created in the correct order like master Z points out....

Following David, but I'm having this warning too and no mi exported (Render View Or Batch Render) :


// Warning: (Mayatomr.Custom) : mip_binaryproxy1: reference to invalid instance, ignored //

Ash-Man
05-27-2008, 05:37 PM
read what I told Eshta

he had them the other way around

mlykke
05-29-2008, 02:16 PM
First thanks to David for helping me out. :applause:

Guess my head is still somewhat in 3dsmax mode, this took me a bit to get working. After you making sure that you have the correct Maya, you can try these 10 steps/tips/pointers think might help people:

1. have mental ray as your current render ;)
2. When learning this for the first time, make 2 spheres. One with low number of polygons called "low", and another with a high number of polygons called "high".
3. Objects that you are gonna make into a mental ray proxy CAN NOT be in a group ect.
4. "high" is the object that we want to be saved out as a *.mi proxy.
5. "low" is the object that will get the mip_binaryproxy.
6. the "high" object should be place ABOVE the "low" in the outliner.

After you have made the two objects, you do have the hypershader open and run this line from the script window:

createNode "mip_binaryproxy";
7. Open up the attributes window for the "low" object, select the transformation tab and click "Enable Geometry Shader" under the mental ray section. Next you drag the mip_binaryproxy from hypershade to the Geometry Shader slot.

8. In the mip_binaryproxy you add the path to where you want mentral ray to save the special *.mi format version of the "high" object. Fx. d:\mrproxy\test.mi

9. Check out the Write Geometry flag, and under Geometry type in box write high.

10. Render your scene, and check that the test.mi file has been made. If it has been made you can now delete the "high" object. Also remember to uncheck the flag for Write Geometry in the mip_binaryproxy node on the "low" object.

You are now done and can rerender and see your low detail object render as a high detail version.

Hope this helps one or two people.


PS. if you want to make more copies of the "low" object that also have the mip_binaryproxy node, you will have to use the duplicate special options to make sure the mip_binaryproxy node is added also. The "Duplicate input connections" worked for me, but i'm far from a master of maya so test it out if you want.

achoury
05-29-2008, 04:19 PM
First thanks to David for helping me out. :applause:

Guess my head is still somewhat in 3dsmax mode, this took me a bit to get working. After you making sure that you have the correct Maya, you can try these 10 steps/tips/pointers think might help people:

1. have mental ray as your current render ;)
2. When learning this for the first time, make 2 spheres. One with low number of polygons called "low", and another with a high number of polygons called "high".
3. Objects that you are gonna make into a mental ray proxy CAN NOT be in a group ect.
4. "high" is the object that we want to be saved out as a *.mi proxy.
5. "low" is the object that will get the mip_binaryproxy.
6. the "high" object should be place ABOVE the "low" in the outliner.

After you have made the two objects, you do have the hypershader open and run this line from the script window:

createNode "mip_binaryproxy";
7. Open up the attributes window for the "low" object, select the transformation tab and click "Enable Geometry Shader" under the mental ray section. Next you drag the mip_binaryproxy from hypershade to the Geometry Shader slot.

8. In the mip_binaryproxy you add the path to where you want mentral ray to save the special *.mi format version of the "high" object. Fx. d:\mrproxy\test.mi

9. Check out the Write Geometry flag, and under Geometry type in box write high.

10. Render your scene, and check that the test.mi file has been made. If it has been made you can now delete the "high" object. Also remember to uncheck the flag for Write Geometry in the mip_binaryproxy node on the "low" object.

You are now done and can rerender and see your low detail object render as a high detail version.

Hope this helps one or two people.


PS. if you want to make more copies of the "low" object that also have the mip_binaryproxy node, you will have to use the duplicate special options to make sure the mip_binaryproxy node is added also. The "Duplicate input connections" worked for me, but i'm far from a master of maya so test it out if you want.

hi
for the "low" object you can do it with just a cube or just a one surface polyplane.
and the mi file is created as binary format no way to edit it.
since the mip_binaryproxy must be connected to the geo shader of the transform, i am asking why we cant' use a locator or a null object or an empty group or a transform node ( createNode transform) all theses have a geo shader!
of course we can connet the mip_binaryproxy there, but no .mi file generated !

/rachid

lazzhar
05-29-2008, 07:06 PM
I'm wondering if anyone got any success to use this for an object with full material/textures. Because in my trying, it just renders with plain old lambert. It was those PaintFX trees converted to polygons of course.

acidream
05-29-2008, 07:49 PM
I'm wondering if anyone got any success to use this for an object with full material/textures. Because in my trying, it just renders with plain old lambert. It was those PaintFX trees converted to polygons of course.

from my limited testing, i found that it doesn't export the textures to the .mi file, but if you reassign your texture to the proxy object it will render correctly. unfortunately this limits you to one texture. I was able to fully texture the leaves and the trunk of a converted pfx proxy tree with a bit of creative uv mapping and a mix8layer, but its defintely limited at this point.

wat2k
05-29-2008, 11:47 PM
How can I bake animated shape into binaryproxy?
And what do the Meter scale and flag mean to?

Bitter
05-30-2008, 06:09 AM
It does have a limited scope right now, objects that are combined and share a shader. For groups of objects/sub-scenes the solution is an assembly but there's not a shader for it right now.

I was rather happy with altering a few shaders, scaling and transforming some proxies and rendering out a forest of about 117 paint effects trees with BSP2 in about 3 minutes. That's about 73 million triangles but instanced from the original object, so the output was just over 600,000 polys.

I can think of a lot of things this will help. Will be testing more later like dynamics and such.

wat2k
05-31-2008, 03:00 PM
How to apply displacement shader to proxy? I simply connected a map to displacement slot and it didn't work.

Bitter
05-31-2008, 08:07 PM
I created a surface with the displacement applied. The surface that it created had the displacement already when I rerendered with the proxy. I could apply any shader (one without a displacement) and the recalled object still had the original displacement.

wat2k
06-01-2008, 04:22 PM
I created a surface with the displacement applied. The surface that it created had the displacement already when I rerendered with the proxy. I could apply any shader (one without a displacement) and the recalled object still had the original displacement.

Thank you very much. So the proxy has embedded displacement shader !!!??

Bitter
06-02-2008, 07:09 AM
No, I think it simply writes the displaced geometry after the displacement runs. But I could be wrong.

Bitter
06-04-2008, 09:52 PM
Ok, here's a catch.

I tried writing out something simple like blowing paint FX grass. I converted to polys and left the history and the stroke. The first batch is fine, grass blows along. . .

But replacing the grass with the proxy grass, it no longer blows. I know it bakes deformations, but this is apparently something else where it doesn't pick up the deformation. Am I missing something to get this to work?

This would be a great way to eliminate complex or heavily instanced items like Paint Effects or hand modeled natural (repetitive) features. But I need the animation to go with it.

JayHoo
06-26-2008, 10:03 AM
I have tried to plant maybe 200 trees in a scene and it worked pritty good.

But another problem is, that I cannot use the render states. The options in the transform node are not as complex as the one from the render states. There is a checkbox "derive from Maya" but it ignores the setting under render states. In my case I want to uncheck "cast shadows".

The problem here is that under the transform node the shadow pull down menu only offer yes or no.

Sagroth
07-15-2008, 08:10 PM
That's from production.mi file:

# One meter in scene units;
# Stored as info when saving, and
# scaled relative to it when loading
# if zero, no rescaling is done.
scalar "meter_scale",

# Flags. Reserved for future expansion;
# Use 0
integer "flags"

So, actually, no magic here :)

Sagroth
07-16-2008, 12:54 AM
Concerning instancing animation...

As well as I understand, this shader is evaluating again and again as each frame renders and overwrites the previous .mi file. So, no animation/deformation is written to the .mi

The trick is to create a sequence of .mi files for each phase of animation. You just need an expression that overwrites filename for each frame, smth like this:

setAttr -type "string" mip_binaryproxy1.object_filename ("d:\\temp\\anim." + frame + ".mi");
and then render the frames you need. Even more tricky thing is to read this sequence. You need the same piece of code to change filename each frame, but this shader seems to like being translated just once in the first frame and hence used for the whole sequence. To force it update you need to add a fake attribute to shader and animate it - that way it'd be translated again and again each frame.

I couldn't make switch nodes work to vary colors or time offsets for instances using the same shader. That's a big disappointment. Anyway, making a script to create mip_binaryproxy for each placeholder is not a big deal. Then you can add another attribute to each one, smth like frameOffset with random value and then modify expression smth like:

string $bps[] = `ls -type "mip_binaryproxy"`;
for ($each in $bps) {
int $off = `getAttr ($each + ".frameOffset")`;
setAttr -type "string" ($each + ".object_filename") ("d:\\temp\\anim." + ((frame+$off)%12+1) + ".mi");
}
Eventually, you get random offset of looping animation for each instance. Same could be done to material shaders, maybe some animation retiming and stuff. Though, there's a lot of work to do to make it all usable. Right now don't see any advantages over particle instancing with looping shapes.

Would be great to hear if someone made more progress in this field.

CGTalk Moderation
07-16-2008, 12:54 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.