Jump to content

IFD?


Recommended Posts

Post from Jason -> recent changes in OdWiki -> Mantra -> IFD

IFD!

I just discovered there was a scene description language for Mantra just like Renderman RIB. ( maybe i'm gonna understand how instancing works).

But i didn't find any info on how to write(program?) in IFD. Just opened a IFD file with my textpad. It's structure is very similar to RIB.

Is there any info about the .ifd file structure? or IFD programming?

George Stevens wrote

Since the ifd language is a sub-set of the hscript scripting language, there are other possibilities that aren't used by Houdini. For example, any commands will expand variables and allow expressions to be evaluated using the back-quote (`) mechanism. As well, it's possible to code for loops, foreach loops, if/endif blocks etc.
Link to comment
Share on other sites

Hi there,

Actually, it's more a command structure than RIB, which really defines a scene and lets PrMan render it once its defined.

The IFD is a sequential command structure and so you can do some interesting things, like For loops and such.

I'll try to find the document I have on the IFD commandset and post it up somewhere. I think its got some HTML formatting that won't post to od[wiki] so well, but I'll let you know.

Link to comment
Share on other sites

Actually, it's more a command structure than RIB, which really defines a scene and lets PrMan render it once its defined.

-> So is RIB !

( not .rib but RI Api, which directly sends commands to the renderer, or writes them down into a .rib file)

The IFD is a sequential command structure and so you can do some interesting things, like For loops and such.

-> Yes, exactly what i was looking for ! :)

I'll try to find the document I have on the IFD commandset and post it up somewhere. I think its got some HTML formatting that won't post to od[wiki] so well, but I'll let you know.

-> Many Thanks ! :)

Link to comment
Share on other sites

Here is some information for you:

IFD Format Document

@Stremik:

If I was you, I'd generate a quick scene to test my shader and write the IFD file out. (Generate Script File). You can then invoke mantra on this file:

mantra  < myscene.ifd

If you are editing VEX .vfl files in an external editor, you can then just recompile it and it should work. All the shaders are referenced externally of the IFD by default. You can compile directly to .OTL files using the vcc commandline options.

Hope this helps,

Jason

(You could make a small tcshell script that invokes mantra on your test IFD if the compile was successful.)

Link to comment
Share on other sites

All right. I need some help here.

I can't figure out how to move around the geometry, camera and light

objects. and how to point the last two in different directions.

The whole idea of matrices used in ray_transform totally escapes me.

For example, what the heck is going on in this line of code?

ray_transform 1 0 0 0 
Link to comment
Share on other sites

The idea behind matrices is, that you can express an arbitraty transformation using just these 16 numbers. This is a much better way than to tell the program that you move the object in x-direction 2 units, then rotate along y-axis 45 degrees, translate now in y-direction 1 unit and at last scale in z-direction by 2, etc. You can go on with that sequence as many times you want (and get an unlimited sequence of numbers), but you can always collapse the transformation into these 16 numbers. But they can even more: You are able to express a shear or the perspective distortion, that happens during the projection into a 2D image with the matrix. All these possibilities made matrices a nice entity to express a generic transformation.

Points are transormed by multiplying them with a matrix. (Take a look at What is a matrix? by MCronin on od[wiki]). Here comes another trick into play: homogeneous coordinates.

Simply spoken the homogeneous representation of a point in 3D-space is |x y z 1|. You just add a one in the 4th dimension. Exactly there can be any number in the 4th coordinate, which is called w. For example the vector |x y z w| has the three-dimensionlal representation |(x/w) (y/w) (z/w)|. You need to do this to be able to express a translation with a vector-matrix-multiplication.

You know how to translate a point by the vector |tx ty tz|:

ray_transform 1 0 0 0   0 1 0 0   0 0 1 0   tx ty tz 1

In matrix form this is written as:

                 |  1  0  0  0|
|x y z 1| * |  0  1  0  0| = | (x+tx)  (y+ty)  (z+tz)  1|
                 |  0  0  1  0|
                 | tx ty tz  1|

A rotation matrix looks different. For example a rotation around the x axis:

                 | 1          0                 0         0|
|x y z 1| * | 0   cos(alpha)    sin(alpha)   0|  = <rotated vector>
                 | 0   -sin(alpha)   cos(alpha)   0|
                 | 0          0                 0         1|

Assume alpha=30

Link to comment
Share on other sites

Well, my IFD saga continues!

Now, when I apply an shader to a geometry and render away I'm getting a black frame. The only shader that works is a "constant". Any other, is being loaded but not being rendered or something else.

here is whatI have in my IFD file:

ray_verbose 4

ray_picture ip

ray_resolution 512 480

ray_zoom 1

ray_clip .01 100

ray_detail -s geo1 $HOME/houdini6.1/geo/pointlight.bgeo

ray_object light1 geo1

ray_transform 1 1 1 0

Link to comment
Share on other sites

The reason is to prevent people from abusing the Apprentice plan and generating IFDs and circumventing the NonGraphical license requirement. Just be assured that an IFD is being fed into mantra invisibly.

Having access to this file can be useful on very intricate systems where it may be more efficient to do things like shader replacements and such on very heavy scenes. For example; we had a system that had 40 high-resolution cars all instanced around a scene (up to 8000 instances in one scene, actually), each car compromised of a number of shaders. It worked out to be more efficient to replace and vary the shaders inside the IFD on the way to render then to generate the IFD's many times and battle with our own UI problems.

Steve Blakey here now wakes up in the middle of the night burbling IFD commands.. much to the horror of his poor girlfriend.

Link to comment
Share on other sites

I don't see why someone would do such thing.

Even if you render by feeding IFDs to mantra without actually starting Houdini,

the image resolution is still limited.

I'm not talking about RIB here. That's a different story, but IFD...

I think it would be ok to be able to save out an IFD.

Link to comment
Share on other sites

Imagine a shop with 10 licenses of Houdini and 100's of render machines. They will very probably have a site-license of mantra due to the number of Houdini licenses they own. They will have a rendering bottleneck because they cannot generate IFDs fast enough from their 10 licenses of Houdini. If they could output IFD from a whole bunch of Apprentice cuts and then process IFD and change the output resolution and then they could feed these IFD's to the licensed mantra versions for render.

This is because on intensive, complex, highly procedural scenes, Houdini cooking out an IFD can take a long time - even nearly as long as a render.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...