Iray Single Sided Faces?
![algovincian](https://farnsworth-prod.uc.r.appspot.com/forums/uploads/userpics/244/nARKTD206Y8PK.png)
Is there any way to get Iray to *not* treat every face as having 2 sides when rendering? Thanks in advance for any info anyone can provide.
- Greg
You currently have no notifications.
Is there any way to get Iray to *not* treat every face as having 2 sides when rendering? Thanks in advance for any info anyone can provide.
- Greg
Licensing Agreement | Terms of Service | Privacy Policy | EULA
© 2025 Daz Productions Inc. All Rights Reserved.
Comments
Backfaces are culled if they have no influence in the scene, but if the polys are visible either directly through the camera or a reflection, or contrinute to coloration or light via reflection, then Iray will assume you want them. If Iray provides a user setting for culling all backfaces, D|S doesn't make it visible.
Depending on what you are doing, a matte surface, positioned behind the object, *might* accomplish your goals. Hard to know without specifics.
Thanks for taking the time to respond, Tobor. In this simplified example, the sphere is emitting light, which passes through the plane and illuminates the torus:
I'd like to accomplish 2 things:
1. the plane to be completely transparent as far as blocking any light from illuminating the torus
2. the camera to see the sphere at a fraction of its brightness
I was hoping to able to accomplish this by applying different materials to the front side & the back side of the plane. I realize that Iray tries to be physically plausible and this may not be possible. It also may (probably) be the case that Iray only shoots rays from the camera (and not from light sources), which would make this impossible.
- Greg
There may be hope!
The following excerpt is taken from the NVIDIA Material Definition Language 1.1:
http://developer.download.nvidia.com/designworks/mdl-sdk/secure/nvidia_mdl_introduction.140512.A4.pdf?autho=1471534538_b2371a41d96af1387dda6cd32749e610&file=nvidia_mdl_introduction.140512.A4.pdf
MDL provides a purely declarative syntax for describing the interaction of an object with light. It relies on predefined building blocks that can be efficiently implemented in a modern renderer, yet are powerful enough to describe a large majority of real-world materials. The renderer-side interface of the material, the material model, is represented by a MDL built-in structure-like type, which contains the different properties of the material:
struct material {
uniform bool thin_walled = false;
material_surface surface = material_surface();
material_surface backface = material_surface();
uniform color ior = color(1.0);
material_volume volume = material_volume();
material_geometry geometry = material_geometry();
};
Depending on the building blocks used, three different kinds of materials can be distinguished:
1 Regular materials describing a surface that separates one volume from another
2 Thin-walled materials where the geometry only describes a soap-bubble like shell
3 Two-sided materials which also have the thin-walled property, but interact differently with light hitting
the geometry from the back side
This clearly isn't something I'm going to find a solution to over a lunch break lol.
- Greg
Yes, it is possible. MDL permits it. By declaring the material as thin_walled=true, and setting surface to a regular surface (non-transparent) and backface to a transparent surface, you'll get the desired behavior. This allows simulation of things like one-way mirrors and such.
It has to be implemented at the MDL level, however. You'll need a specific MDL shader written to accomplish it. I don't think any of the samples iray shaders use this feature (at least not in an exposed manner where you could adjust them.)
It does both. There are path passes from eye to light, and light to eye. Not sure if this really helps you though...
Thanks for taking the time to respond, hphoenix - I appreciate it.
I've started the process of going through it all the MDL documentation and looking at the way things are structured. Unless I'm not understanding (which is possible - maybe even likely lol), it looks like the cutout opacity is tied to the geometry, so it can't be set differently for the surface and backface. I think I've got 2 options at this point - either set the cutout opacity to be a function of whether or not the normal is forward facing or not, or find a way to set the transparency of the surface and backface via distribution functions.
- Greg
You can't use cutout_opacity.....but you CAN specify a specular_bsdf with specular_transmit as it's mode. Set IOR to 1.0, tint to pure white. It becomes wholly transparent glass on that facing.
Thanks for your thoughts. Maybe I'm being a bonehead, but Iray as implemented in DAZ does not seem to render in this way. For those interested (maybe this will help somebody else in the future), here is the MDL I imported into Shader Mixer:
And here are 2 screencaps showing 2 different settings for front_tint and the corresponding renders:
Thanks again for those taking the time to read/comment - I do appreciate it!
- Greg
Hey Tobor - if you get a chance, check out the 2 renders in the previous post. When Iray is calculating the color of a pixel on the sphere (light source), it appears to using a ray from the camera going through the front side of the plane (thus tinting the portion of the sphere that is behind the plane). When Iray is calculating the color of a pixel on the taurus, it again appears to be using a ray starting from the camera going through the front side of the plane to get to the light source. This is as opposed to using a ray starting at the sphere (lightsource) going through the backside of the plane (and thus not tinted) to get to the camera.
Questions (thinking out loud):
Is the surface/backface determined by the normal direction alone, or does it possibly include the which side is facing the ray's origin? (in which case the "back" side of the plane would become the "surface" from the sphere's perspective)
Do I need to specifically add geometry to the material in order to define a normal? (I assumed this was done by default as so many materials do not do so)
<shrug>
- Greg
I don't think anyone outside nVidia knows the algorithm for Iray's eye-light ray tracing. Tracing from camera back to light is part of an optimizing process that is not intended to alter how the scene is physically reproduced in the end. The idea is that you won't see the see the direct effect of it in your renders, unless you're trying for an unusual set of materials, which you are. (Or you look very, very closely.)
The wiki page on Lux Render shows how the basic system works. I have no idea what algorithms Iray uses, but we do know that it offers no user-settable options to control it. If this is something that you need to look into more deeply, remember that you can use D|S to render through Lux. The Reality plug in (which I have but don't use very often) makes converting lights and materials pretty straight forward.
http://www.luxrender.net/wiki/LuxRender_Render_settings#bidirectional
As a followup, the Architectural sampler is probably working with the bidirectional path tracer in Iray, modifying it in some way(s). You could try variations with and without the sampler activated. Same with the caustics sampler, though do keep in mind that with both of these turned on, render times can be longer, even if there's no discernable difference in the output.
If you happen to try out a frosted glass lampshade with an internal flame/bulb or some such, the lampshade is much more realistic with the caustic sampler switched on.
Thanks for the info re: Lux, Tobor, and for a couple more easy things to try.
This does sound like a similar situation, and promising!
- Greg
The caustic sampler did not change the render results - bummer. On another note, I have been exploring MDL in Shader Mixer, and was able to create the same network with the functionality that DAZ has exposed (without the need to import any custom MDL). For those that are interested:
I do plan on continuing this by running a few simpler experiments in an effort to figure out exactly how DAZ's implementation of Iray is rendering some of this MDL.
- Greg
Using the IrayUber MDL is handy, but keep in mind that many of its nodes are turned on and off depending on the values of other nodes. Go through the code and look for ternary expressions that might have an impact on the nodes you've imported. Be sure any collaborative values for these are set. That could entail bringing in a node, and at the least setting a default value for it.
I think you misunderstand how two-sided works in Iray. The light still passes through BOTH sides. Thus, both BSDF functions apply to that light. The tint you applied to the 'front' face is filtering the light coming through. So naturally, the tint you apply to the 'front' also affects the lighting. So in the above example, you are getting very dark grey light, instead of bright white light. When you change the tint for the 'front' face to white as well, it shouldn't go invisible, though.
Not sure, but it may be that you've got it set to a specular BSDF. I wouldn't go with specular BSDF for the front face.....but I'm not sure how a diffuse BSDF would affect the two-sided pass-through lighting in Iray.
This does seem to be the case. When I first posed my original question, I was assuming (incorrectly, it would seem) that light was only effected by surfaces facing the incident ray.
I was looking for a way to have the plane tint what the camera sees behind the plane, while not tinting the light reaching the objects in the scene in front of the plane. While I don't think it's possible in Iray (after this little exercise), I have at least gotten my feet wet with MDL. Thanks again for taking the time to read/respond.
- Greg