Page 1 of 1

How to do Stencils?

Posted: Fri Jan 07, 2011 1:54 am
by SamCameron
Hi people, I'm new with Octane Render, and I would like to know how to do an stencil in Octane, I tried with nodes but I don't get the result I want, what I want is to have a material with two layers on it, one textured image with it's own colors and desings and in the surrounding of the material the base material, I'm not sure if you get my idea, anyway any suggestion or comment is more than welcome, thanks in advance.

Re: How to do Stencils?

Posted: Fri Jan 07, 2011 5:30 am
by yoyoz
You can do as follow:
- create a node 'clamp texture' (textures->mappings->clamptexture)
- load a black & white version of your texture as a floatimage
- create a node 'material mix', link the clamp texture to the 'amount' input
- link your 2 materials (base and textured) to the 2 inputs of the mix
- if result is inverted, either set 'invert' to true in mix or switch inputs

If you plan to have multiple stencils on same object, you must probably assign them different materials so you have different inputs in your obj. In the example below, you can see Mat_Steel is used twice, once alone and once as a base material with a stencil.

Yoyoz

Re: How to do Stencils?

Posted: Fri Jan 07, 2011 12:24 pm
by SamCameron
Thank you very much, I really apreciated , this workflow seems a little bit complex for such a standard feature, in other engines you don't need to tweak so much to have the same result, speacially if Octane Render doesn't import materials from the main 3d program, all that imports is just the meshes without the corresponding materials or textures so once I import the model from my main app with textures and everything right into Octane Render I need then to re-assing materials, create materials, assing textures all over again, it's kind of time wasting.

Re: How to do Stencils?

Posted: Fri Jan 07, 2011 1:03 pm
by yoyoz
Thanks, I'm not sure this is the only approach, but this is what I figured out by playing around. May be someone else has a better solution :-)

I only have two problems with this workflow at the moment:
- if I add a material in Blender and re-export/import, the nodes may be wrongly reconnected. I thinks this will be fxed with next beta.
- the textures are only linked if I export to Wavefront, but not if using the addon. But this script is not even supposed to work on 2.56 so nobody has to be blamed.

I also have to admit I like to play with the materials in Octane, even if I'm an absolute beginner :oops:

Re: How to do Stencils?

Posted: Wed Jan 12, 2011 6:46 am
by msciwiarski
yoyoz wrote:
I only have two problems with this workflow at the moment:
- if I add a material in Blender and re-export/import, the nodes may be wrongly reconnected. I thinks this will be fxed with next beta.
Yes it's very frustrating.. I've spent a lot of time making all node connection for my car model.. and I wanted to add one more object and material in blender.. After reexporting to octane .. all may work has gone

What is the algorithm of imports for materials in Octane ?? random ?? :) I think that it should be sorted by alphabet order or something...

arghhh.... :(

Re: How to do Stencils?

Posted: Wed Jan 12, 2011 12:53 pm
by GeoPappas
I have found that the following workaround has worked for me, but I have no idea if it is a universal fix or not.

After I have added a new material in Blender and exported, I will then open up the MTL file and search for the new material and put it at the end of the file. It seems that Octane is looking for materials in a certain order upon relinking.

This process worked for my last project. I was rendering a luxury car but I wasn't totally happy with using an HDRI, so I later added four new mesh lights within Blender. I gave each new mesh light a different material (so that I could control them individually within Octane). Once I exported the mesh, I then opened up the MTL file and moved the four new mesh light materials to the end of the file. Once I relinked in Octane, the new mesh lights showed up properly (along with everything else).

Re: How to do Stencils?

Posted: Wed Jan 12, 2011 1:06 pm
by msciwiarski
Hi GeoPappas,

Thanks for the tip,, I will try it today..
But, IMO sorting the materials by alphabetic order in Octane would be very helpfull. Finding the materials in Graph editor by the material name would be easier... At this moment I have about 60 materials and 1st material is "Window_glass", 2nd is "Tyre", 3rd is "Lamp" etc... they are not sorted...

Cheers

Michal