AuthorTopic: RIBRobin Toolkit (Read 12380 times)

IntroductionWelcome to the RIBRobin Toolkit! This series of scripts lets you setup a scene right in the object editor for export to either 3Delight or RenderPixie!

Current Features

Camera

Implementation: Click on icon in left toolbar, click and drag anywhere in work space. Double click to set values.

Width: Width of image that'll be rendered. Represented by the relative width of the camera's viewing rectangles. [640]

Height: Height of image that'll be rendered. Represented by the relative height of the camera's viewing rectangles. [480]

FOV: Field of Vision. [60]

NearClip: Anything closer to the camera than this gets culled. Represented by the rectangle in front of the camera mesh. Non-uniform scale on the y-axis changes this value. [50]

FarClip: Anything farther from the camera than this value gets culled. Represented by the rectangle furthest from the camera mesh. [1000]

DOF:Enables Depth of Field. DOF does not render when Ambient Occlusion or orthographic is enabled. When activated, the camera receives a series of circle guides in its viewing range that represents the "circle of confusion" at that depth. Basically, the larger the circle, the more blur there will be at that spot. Giving DOF a value of 2 gives it a very dense representation (one circle every 10 units), whereas giving DOF a value of 1 makes it more sparse (one circle every 100 units). A value of 0 disables it. [ 0 ]

f-stop: To make it easier to understand, just think of f-stop as a "scale" of sorts. The smaller the number, the larger the circles get. You can use either his or Focal Length or both. They scale the same way except at different values. [ 0.5 ]

Focal Length: This also scales the circles of confusion. A higher value equals a larger scale. Combine this with f-stop to get the blur you want. [ 45 ]

Focal Distance: The image is sharpest at this distance away from the camera. This is represented by a division located between the near and far clip. You'll notice that the circles of confusion are at its thinnest at this point. The best strategy is to set this value first before messing around with Focal Length and Focal Distance. [ 500 ]

Orthographic: Changes the camera from perspective to orthographic. The camera's lines that represent its field of view change form accordingly. Non-uniform scale on the x-axis changes its width/height. [ 0 ]

Ambient Light

Description: This object lights the entire world evenly, and is non-directional. You can place it anywhere in the scene and it'll have the same effect.

Implementation: Click on icon in left toolbar, click and drag anywhere in work space. Double click to set values. The Emmissive RGB values in its corresponding material determine the light's color.

Intensity: Intensity of the light. For ambient lights, it needs to be set fairly low[100]

Distant Light

Description: This object lights the entire world evenly, in one direction. You can place it anywhere in the scene and it'll have the same effect. It's the same as Anim8or's infinite light.

Implementation: Click on icon in left toolbar, click and drag anywhere in work space. Double click to set values. The Emmissive RGB values in its corresponding material determine the light's color, and the arrow's direction shows the light's direction

Implementation: Click on icon in left toolbar, click and drag anywhere in work space. Double click to set values. The Emmissive RGB values in its corresponding material determine the light's color.

Intensity: Intensity of the light. For spot lights, it needs to be set fairly high. (Poorly) Represented by the light's cone distance[Uniform Scale]

Cone Angle: This is the overall cone angle of the spot light. [ 30 ]

Delta Angle: This is the "inner" angle of light. Light will focus harder on this width when given a high beam distribution (maybe) [ 5 ]

Beam Distribution: The higher the number, the more "focus" it has. [ 2 ]

Casts Shadows?: 0 = disabled, 1 = enabled. [ 0 ]

Shadow Samples: Number of samples shadows are rendered at. [16]

Shadow Width: The "softness" of the shadow. [1]

Point Light

Implementation: Click on icon in left toolbar, click and drag anywhere in work space. Double click to set values. The Emmissive RGB values in its corresponding material determine the light's color.

Intensity: Intensity of the light. For point lights, it needs to be set fairly high. [100]

Casts Shadows?: 0 = disabled, 1 = enabled. [ 0 ]

Shadow Samples: Number of samples shadows are rendered at. [16]

Shadow Width: The "softness" of the shadow. [1]

AO Options

Description: This shape carries the ambient occlusion options for you to tweak its settings as needed. Please note that all but the first three settings apply only to point-cloud AO, and most of those are for 3Delight only. Fully raytraced Ambient Occlusion is mostly automatic, except you can set its bias and samples here. All default settings should turn out decent results for most cases.

Implementation: Click on icon in left toolbar, click and drag anywhere in the work space to create it. Double click object to set values.

Enabled: 0 = disabled, 1 = enabled. [ 0 ]

Bias: Offsets the computation points a bit above the original surface. This can be necessary to avoid self-occlusion on highly curved surfaces. In other words, higher numbers can reduce artifacts, but may cause other problems. [ 1 ]

Falloff: This shapes the falloff curve based on Falloff Mode. Scanline- and 3Delight-only.[ 0 ]

Max Distance: Can decrease render times in large scenes if you set the max distance to only the range you want to shadows to be calculated, but otherwise changing this value won't give a noticeable bump in speed[ 1e+005 ]

Clamp: Point-based AO (scanline) usually computes too much occlusion, so set this to 1 to make it look good. Nearly doubles the render time. Scanline- and 3Delight-only. [ 0 ]

Max S. Angle: Max Solid Angle is a straightforward time-vs-quality knob. It determines how small a cluster must be for it to be a reasonable stand-in for all the points in it. Reasonable values seem to be in the range 0.03 - 0.1. Lower numbers = better quality. [ 0.05 ]

Sample Base: A number between 0 and 1 that determines the jitter for computation points. Setting to 0.5 or higher may be necessary to avoid thin lines of too low occlusion where two (perpendular) surfaces intersect. Scanline- and 3Delight-only. [ 0 ]

GUI Size: This is how big the Scene Options dialog will look in your workspace. You can scale it with the uniform scale tool, so usually you don't have to bother setting the numbers manually.[ 1 ]

Render Passes

Description: If you want to save each major channel (diffuse, ambient, alpha, etc) into a separate image file, you can set that option here

Implementation: Click on icon in left toolbar, click and drag anywhere in work space to create it. Double click object to set values. 0 is disabled, 1 is enabled

Diffuse: Diffuse channel (development still in progress)[ 0 ]

Ambient: Ambient channel (development still in progress)[ 0 ]

Depth: Depth channel (development still in progress)[ 0 ]

Alpha: Alpha channel (development still in progress)[ 0 ]

Specular: Specular channel (development still in progress)[ 0 ]

GUI Size: This is how big the Render Passes dialog will look in your workspace. You can scale it with the uniform scale tool, so usually you don't have to bother setting this number manually.[ 1 ]

Implementation: Click on icon in left toolbar, click and drag anywhere in work space to create it. Double click object to set values.

Renderer: 0 = 3Delight, 1 = Aqsis, 2 = RenderPixie. There are specific features where the output has to be changed specifically for the renderer you are using. Hence this option so that it will be automated for you. [3Delight]

AO Samples: The higher the number, the more samples and therefore the better it'll look, at the cost of render speed. [ 32 ]

Bias: A lower number can introduce more AO artifacts but it'll look sharper. Best to adjust at small doses [ 1 ]

GUI Size: This is how big the Scene Options dialog will look in your workspace. You can scale it with the uniform scale tool, so usually you don't have to bother setting the numbers manually.[ 1 ]

Setup, Exporting, and RenderingDownload the Toolkit using the link in the Release log. The .zip file will include multiple .a8s (Anim8or scripts) files, folders, .sl (shader) files, and Convert.exe (converts image files). Delete ALL previous versions of RIBRobin completely! Then extract the entire contents of the folder into your Anim8or Scripts directory.

Current structure of the .zip file contents:

/archives - directory that holds all associated .rib files that are called by your main .rib file

/shaders - directory that holds all source shaders that the shader compilers look in and compile to.

/textures - directory where convert.exe and the renderer's texture optimizer place converted textures for use by the .rib file

convert.exe - ImageMagick program that the .bat file uses to convert all textures to the .tif format

IMGMAGICK_LICENSE - ImageMagick's license. Read it if you feel like it.

readme.txt - Readme file that gives some trivial info and points to this forum topic

RIBRobin_Camera.a8s - Anim8or script that contains the Camera shape

RIBRobin_Export.a8s - The brunt of the RIBRobin work is done by this file

RIBRobin_Light_Ambient.a8s - Ambient light shape

RIBRobin_Light_Distant.a8s - Distant light shape

RIBRobin_Light_Point.a8s - Point light shape

RIBRobin_Light_Spot.a8s - Spot light shape

RIBRobin_Scene_AO.a8s - Ambient Occlusion dialog shape

RIBRobin_Scene_Options.a8s - Scene Options dialog shape

RIBROBIN_Scene_RP.a8s - Render Passes dialog shape

Set up your scene with the Toolkit's camera, lights, and other RIBRobin shapes available in the left toolbar. Set your renderer by double clicking the Scene Options object after you created it in the workspace. You can set up other parameters in the Scene Options shape, the Ambient Occlusion shape, the Render Passes shape, and the Camera shape. All other shape objects have parameters pertaining specifically to the Renderman component that it represents.

If you're ready to export, go to Object->Export... and select the Renderman (.rib) file type, specify the file name and directory (it can be any locations), and hit Save.IMPORTANT: The exporter doesn't just save a .rib file. It also saves .sl (shader language) files that are needed by the .rib file, and a .bat file that compiles the textures and shaders and then renders the .rib for you, via command line. The .bat file gets saved in the same directory as the main .rib file. All other files get saved into the folders mentioned above and don't need immediate attention unless there was an error.

So to render your .rib file, assuming you have your renderman renderer installed and you set the correct one in the Scene Options shape, double click on the .bat file that was generated in the same directory as your .rib file. It'll be called something like x_y_z.bat, where x is the same name as the .rib file, y is the name of the object you exported from, and z is the name of the renderer. It will perform four steps depending on your scene's contents:

Associated textures will be converted to .tif using Convert.exe and saved in the textures directory

Those converted textures will then be compiled into whatever format the renderer requires, using that renderer's texture optimizer.

Any associated Shader Language (.sl) files will be compiled using the renderer's shader compiler and saved in the shaders directory

Finally, all associated RIB files will be rendered. The final image will be a .tif file with the same name as the .rib file you saved.

Notes

Do not rename any of the RIBRobin shapes. The export script relies on their names to recognize what they are and how they should be processed.

There can only be one camera, named RibRobinCam01

When you download and install the Toolkit, make sure you delete all older RIBRobin Toolkit scripts first. Some file name changes may have occurred resulting in old scripts not being replaced automatically

If you update the toolkit and open an Anim8or file that contains shapes made from the older toolkit scripts, they may need to be replaced depending on what was updated.

RIB Rendering SoftwareThe only RIB renderers supported are 3Delight and RenderPixie. I dropped Aqsis because it was too slow, buggy, and lacked features that the other two had. Not to mention RIBRobin's development is a lot faster now with one less renderer to stay compatible with.

3Delight - Commercial quality. One free license per user, restricted to 2 cores. Best one you can get at no cost.

RenderPixie - Free, but not actively developed anymore. Fast and can make good images.

Development Milestone MarkersNote: Some features marked as complete may not have been released yet.

[ Complete ] [ Started ]

v0.3

Add emissive attribute to phong shader

Per-Poly Materials - As the name suggests, multiple materials per mesh object.

Smarter .bat files - To save time, detect whether or not a texture or shader was modified before regenerating it.

Smooth Angles - Creases get exported properly

Render separate passes - Allows the user to render separate channels as their own images with the option to combine them automagically.

Point-Cloud Based Ambient Occlusion - An automatic setting that renders an AO pass separately from the main renderer

Render Alpha - Renders only the alpha channel

Render RGB - Renders only the RGB channel

Render Depth - Renders only a depth map based on near/far distances

Shadows - Shadows are treated as separate entities, so they'll take a little bit of work.

Focal Blur - Blurs a certain distance/area in the scene for more depth.

Special Materials & Effects

v0.4

Global Illumination - Automatically set up GI when given some parameters

Got a lot done again! All the issues $imon addressed are pretty much fixed, and then some. I'm pretty proud of my Depth Of Field solution On a side note, I'll try to update the documentation (it's kind of getting behind), but if anything play around with the RIBRobin and use common sense.

New Features/Fixes:

Internal: Camera and Mesh rotations are now 100% accurate - That's right. I finally did it. I think.

Cleaner Directories: All generated files get placed in subdirectories in your script path, so as to avoid clutter. You can still save and render your main .rib file anywhere you want.

Normals & Texture Coords Fixed: Smooth angles are now represented properly. If there's a crease on your mesh it's gonna show in the render (unless it's a subdivision object). Texture coords used to not be transferred entirely, now it is.

Materials Per Poly: You can now have multiple materials attached to one mesh. Take note: If it's a subdivision object you'll have a crease where the materials meet (unless they are on separate mesh entities). Try to avoid having more than one material per mesh since the extra sorting slows down the export speed considerably.

Spotlights: Spotlights are a tiny bit better represented in the workspace...*shrug*

Scanline shadows: (or as close to them as you can call it) Spot and point lights enabled. Distant lights are going to probably take some time to implement. Please avoid setting them to cast shadows if you set the render type to scanline.

Smarter .BAT files: .BAT files do not regenerate textures and shaders if it's not needed (saves time). It's still a little rough around the edges, and it'll feed you a lot of error messages, but it'll keep chuggin' along.

Point-Cloud based Ambient Occlusion: Finally implemented. Note however that RenderPixie's version is a little bugged, there is no solution in the near future since it's entirely RenderPixie's fault I'll keep it on my to-do list should I find a work-around.

Ambient Occlusion Dialog: This shape added for tweaking AO settings

Aqsis support dropped: It's slow and has fewer features, so not worth the hassle

Depth of Field: With a nice fancy indicator to show you where it's gonna be blurry. More explained in the first post.

Separate Render Passes: This is also very rough around the edges. The diffuse and ambient channels aren't true representations (I just tossed what I could in there), so don't rely on it too much. It'll likely not be fully implemented until after the more advanced features are finished, since it's heavily reliant on the shaders.

Multithreading: Renderpixie automatically did this, but now you can set the number of threads it renders with in the Scene Options.

Shadows Comparison (Raytrace is casting one extra light)

Point-Cloud vs Raytraced Ambient Occlusion

Depth of Field Demo

Known Bugs and Issues

Emissive values don't transfer

Texture weights don't transfer

Environment Maps don't transfer

Point-Cloud AO in RenderPixie is flawed

Scanline rendering of Distant Lights that have shadows results in errors.

The .BAT files have a lot of error messages in them when handling files that don't exist

Diffuse and Ambient render passes aren't ideal

In general, Scanline shadows are a bit buggy

You have to run the .bat files as an admin in order for it to work. If you're the sole owner and administrator of your computer, then that's not an issue unless you have high security settings.

Grouped objects don't convert properly

.BAT files return a "Failed to find C" error message when rendering with RenderPixie-- but this should not break anything

Scene Options: Scene Overrides changed to Scene Options. You also set the renderer in the Scene Options dialog instead of the camera.

Dialog-based shapes: I'm proud to say I have a table generator that spits out strings automatically as if it were an actual word processor. You can see it in action in the Scene Options shape object. This will help me keep features more user friendly!

Materials almost 100% converted: Emissive is giving me problems so it's not implemented yet. I will probably skip the environment maps and have it automatically convert to real reflections. ASL can't access texture weights, so for now all textures are set at 100% weight if applied.

Internal: Fixed bug where the texture coordinates were vertically flipped

Internal: AO is fixed for 3Delight and RenderPixie. The bias was too low, so I set it to 1. This is now an option in the Scene Options dialog.

Anti-Aliasing: You can now set the Pixel Samples in the Scene Options

Batch file update: .bat file is now more and less verbose

RenderPixie render progress updates: RenderPixie renders now show progress in the framebuffer the way 3Delight does. Aqsis isn't supported since theirs is buggy.

Automatic texture conversion: Convert.exe from ImageMagick is now included to automatically convert any of your textures to tif via the .bat file. Keep this file in the same location as the rib file.

Spot light: It's similar to Anim8or's, but not the same. More details in the first post. The shape tries to reflect where the rays will be going, but it won't be a very accurate representation.

Distant light: This is pretty much the same as Anim8or's infinite light.

Point Light update: Tried representing the point light's intensity with specks of triangles scattered around, but it still sucks. Just bear with it and render test renders to verify all lights' effectiveness.

Orthographic camera: Set to '1' in camera's parameters, then you can scale it using non-uniform scale along the X axis (left click drag), and for both ortho and perspective you can scale the far clip with non-uniform scale along the y axis (right click drag)

Internal: Rewrote the orientation and position code so that instead of transforming all points around the camera, the script rotates the camera and then displaces the mesh objects. This will make it a lot easier to implement features in the future.

Normals Fixed: I hope

Light Positions Fixed: Lights weren't being positioned properly for some reason. Now they are.

Ambient Occlusion: It looks weird I think because of issues with how the mesh is being built. That or it's the normals.

v0.1a - [ Image ]This is the first release. You won't get much useful functionality from this release, but if you're bored or would like to see how it works, feel free to download and try it out.

I tried it out with 3Delight on an old chair model and the result is pretty decent (see attachment). Except as you stated, the AO is a bit messed up on the seat (where there are a lot of poly edges together).

It rendered out a nice tif file with transparent background.

I think the prospect are pretty cool for this if you see the sample images made in combination with other programs.

A difficulty I had now: guessing what will and won't be in the camera's FOV. Not much I guess you can do about that, some trial and error solves it quickly.

I hope that you can keep expanding this - it could be a great asset to Anim8or!

Hey $imon, looks good! It makes me happy to see that it works for someone else as well.

It's true about the camera, which is why I have it represented exactly the same way that the scene editor's camera shows it. But yeah, it'll take some trial and error to get it "just right".

On that note, I do have to put a little warning in...so far converting from quaternions (which is what Anim8or uses) to Euler is not completely accurate. In fact, I don't think Anim8or even converts it 100% correct when you rotate stuff around. Internally it seems Anim8or sticks with Quaternions and then shows you its version of the Euler counterpart. What all this means is that until I figure out a way to get it 100% correct (if that's possible), the rotation of the camera will seem to be off by 1-3 degrees on one or more axis. However, it's not very noticeable nor all that important unless you require rendering with very exact camera orientations.

Nice, Raxx! The new additions seem to be working fine! IT almost is usable as a renderer.. maybe if shadows would work it could start to rival the internal Anim8or renderer.

A few questions about the progress:

- poly material; right now it seems only possible for an object to have one material applied to it: i tried to have polies on an object have a different material, but the whole object changed material. This is not really a priority item since you can use texture maps to define colors on different parts of a model - also if it is a completely different material, it usually is a different object as well. So just a note but no need to act on this.

- texture loading; maybe you can speed up the process by checking if the texture has already been converted, so that this conversion does not have to happen again if you render something twice (checking file name or something), thus increasing render times.

- 'smooth angles' - like they are called in Anim8or - seem to be set at 180 by default.

I'm sure youre well aware of all of this - your progress is very meticulous so far. Can't wait to see some 'advanced' features implemented!

Hey Simon, you seem to have tested it well It's true, these are known issues but it's good that you brought them up, in case others might be wondering about it. I'll explain my intentions here:

Per-Poly materials are not enabled yet since the .rib specification is a little vague on how it would best be implemented. I'm thinking perhaps it's not even possible to implement to the degree that Anim8or is capable of. I would have to separate each mesh by materials so that it's one mesh per material. I think once I fix the normals issue (mentioned further down), it'll look fine for regular meshes, but there could be seams if I split up a Subdivision mesh like that. I will probably get this implemented eventually regardless, but that's the main reason why I haven't done it yet.

It's true that the slow-down caused by constant texture conversion is a bit undesirable. I'm not all that savvy with .bat files, but I think there's a way to check if the texture file is more recently modified than the .tif file, so as to avoid regenerating a texture if it hasn't been changed. I didn't know this until recently, so you can expect this to be implemented soon.

On a side note, shaders always get recompiled as well. But it's a lot faster of a process than when using convert.exe for textures, so it may not be as big of an issue. But if I can do it for the textures, then I can do it for the shaders

Smooth angles are a bit complicated. The way Steve explained it to me, Anim8or automatically exports multiple normals per point depending on if there's a crease there. However, the rib side of things is a little more complicated. As far as I can tell, Renderman only accepts one normal per point no matter what. So I may have to go the "splitting mesh" route again, except I do it whenever I encounter a crease. This kind of "sorting" can get complicated, but it has to be done so expect it to be implemented in the near future.

Believe me, I wish I could have enabled shadows in the first release. However, unless raytracing is enabled (which is slower, isn't as flexible, and Aqsis can't do raytracing--which is why it can't do AO yet), to do shadows I have to make it render depth maps from the point of view of each light source, and do some magical voodoo to mesh it all together into a final render. A point light requires six depth maps (done the same way an environment map is made), a spot light requires one with FOV, and an ambient light needs an orthographic one. This means it becomes a major headache

I will probably make it so that in the Scene Options, you can pick either scanline or raytracing render methods, but only after I implement the scanline shadows first.

I'll add all these things in to to-do list for v0.3!

I also can't wait to get the advanced features like GI, radiosity, etc implemented. Maybe even stuff like texture baking! Once RIBRobin is complete, I intend to work on a fur plugin for it and then who knows what...

It's getting harder to manage the scripts because there's so much stuff in there now. I think I'll take some time off, clean it up a bit, and reorganize the shapes so that they are more intuitive to use.

Whoa! The latest version of RibRobin Crashes with me Raxx!!When I save the file it just sits there Bringing up Task Manager has 100% CPU useage on both threads and cannot get out of it!

Quote

Download the Toolkit using the link in the Release log. The .zip file will include multiple .a8s (Anim8or scripts) files, folders, .sl (shader) files, and Convert.exe (converts image files). Delete ALL previous versions of RIBRobin completely! Then extract the entire contents of the folder into your Anim8or Scripts directory.

Previously I had convert .exe and the sl shader in my objects directory should it still be there?

Hi Kreator. All of the files in the .zip should be in your Anim8or scripts directory. Basically, the list of files you see in the first post is how it should look in your scripts directory (plus whatever other files you have in there). Do you have a scripts directory set? I just tested it and it turns out that it fails if you didn't set one in File->Configure. So I set some defaults but it's recommended that you set a scripts directory.

But I'm not sure if that's the problem. Seems like there's an infinite loop in there. Did you delete all of the old files before putting the new ones in your scripts directory? Did you delete all old RIBRobin shapes from the object (if you're using an old file that contained old versions of those shapes)?

I attached a file that fixes some problems, and updated the release file. Please try it and see if it helps.

If not, then you may have a special case that I haven't tested. Can you email it to me? All I need is the .an8 file.

I'm having some trouble with this update as well, Raxx. I had a model consiting of 40 odd pieces together, exporting this worked partially - the z axis location is off for some of the objects (some went through the floor, others were placed too high.

So I tried joining solids before exporting , but I got the same as kreator - anim8or would freeze up while exporting.

Also, the texture coordinates didn't transfer too well as far as i could tell.

Maybe I'm trying scenes that are a bit too complicated for now - ill stick to some smaller scenes maybe that will work.

Great update feature wise though, congrats!

edit - The weird placement was very probably because of the objects being grouped in anim8or while exporting, I ungrouped it all and the placement seems fine now when rendering. The textures are still not showing up correctly though..