Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] General Discussion => Topic started by: Juzwa on 2014-04-29, 11:06:28

Title: Doble-sided material
Post by: Juzwa on 2014-04-29, 11:06:28
Hi,

Since corona doesn't support any double-sided materials, how can I  acheeve a similar effect?

I have an animated book, flipping the pages. I need the pages to have different texture on both sides. Tried with shell mofifier, and assigning new materal to new faces, but however id doesn't work (even i scanline, i think its  just an unfinished and bugged feature).

So how can i render out double-sided materials in corona?
Title: Re: Doble-sided material
Post by: Ludvik Koutny on 2014-04-29, 11:26:45
Double sided map? :) It's called CoronaFrontBackMap. And if you instance the frontback map also to translucency slot, and give your paper material some translucency, then you will see the text on the other side of the page slightly leaking through when you look at the page against light source... like in real world ;)
Title: Re: Doble-sided material
Post by: maru on 2014-04-29, 12:11:47
Tried with shell mofifier, and assigning new materal to new faces, but however id doesn't work (even i scanline, i think its  just an unfinished and bugged feature).
What? If you make a plane and assign shell modifier to it, in shell options you have possibility to assign different material IDs to your new faces (inner, outer, side). This HAS TO work in both Corona and scanline. It's not a bug, it's unskilfulness. :P

For flipping pages, I would probably use geometry with thickness. But like Rawalanche said, using single-sided geometry with translucency could also bring nice effects.
Title: Re: Doble-sided material
Post by: Tanakov on 2014-04-29, 12:56:12
Not know how to do something, calling it bugged.. well You sound inpatient.

Do you get angry a lot?

Shell is the best option here, theres also an option with alphamapping and AE, but thats the least efficient way.
Title: Re: Doble-sided material
Post by: Ludvik Koutny on 2014-04-29, 13:10:10
Not know how to do something, calling it bugged.. well You sound inpatient.

Do you get angry a lot?

Shell is the best option here, theres also an option with alphamapping and AE, but thats the least efficient way.

Shell is not really best option for something like book pages... And the guy does not sound angry...  he seems normally polite...
Title: Re: Doble-sided material
Post by: Ondra on 2014-04-29, 13:34:46
Tanakov, maru: hey, there is no reason to get personal!
Title: Re: Doble-sided material
Post by: Tanakov on 2014-04-29, 14:15:55
Tanakov, maru: hey, there is no reason to get personal!

Yes Master, I apologize to OP, yet I didnt realize that was mean.

Well I will stand with shell, as It can allow user to get some nice lookin closeups.
But I generaly realize there are better WF's.
Title: Re: Doble-sided material
Post by: Juraj on 2014-04-29, 14:57:17
Not know how to do something, calling it bugged.. well You sound inpatient.
Do you get angry a lot?

This is the weirdest language barrier effect I have yet seen.



Shell is the best option here, theres also an option with alphamapping and AE, but thats the least efficient way.

Most book papers use 80g/m2 or less for pages, the thickness is literally irrepresentable with physical units in CGI, because it's sub <0.1mm. Sure, carton boards (400+ g/m2) are different league.
Regardless, thick papers would be nightmare to animate in flipping fashion.

Rawalanche's advice is sound. Still, 2sided material is convenient way to have completely different material characteristic on each side, but, not any sort of priority for anyone I guess.
Title: Re: Doble-sided material
Post by: maru on 2014-04-29, 15:47:06
Most book papers use 80g/m2 or less for pages, the thickness is literally irrepresentable with physical units in CGI, because it's sub <0.1mm. Sure, carton boards (400+ g/m2) are different league.
Regardless, thick papers would be nightmare to animate in flipping fashion.

Rawalanche's advice is sound. Still, 2sided material is convenient way to have completely different material characteristic on each side, but, not any sort of priority for anyone I guess.
I can imagine a situation when such setup looks strange when viewing the book from its side. But we don't even know what exactly Juzwa is trying to achieve so let's not theorize and get back to topic. :) Also, I didn't want to sound mean.
Title: Re: Doble-sided material
Post by: Juzwa on 2014-04-29, 15:52:24
Hi,

Thanks guys for advises. However angry and prejudiced they might be.

Yes, asking questions, its just silly, i know.

CoronaFrontBackMap does the work for now
Title: Re: Doble-sided material
Post by: romullus on 2014-04-29, 16:07:23
Well I will stand with shell, as It can allow user to get some nice lookin closeups.
But I generaly realize there are better WF's.

I would choose single sided polygons even for close ups. You can simulate some thickness with rounded corner feature of CoronaMtl.
Title: Re: Doble-sided material
Post by: aniow on 2014-10-13, 12:42:43
Double sided map? :) It's called CoronaFrontBackMap. And if you instance the frontback map also to translucency slot, and give your paper material some translucency, then you will see the text on the other side of the page slightly leaking through when you look at the page against light source... like in real world ;)

Thanks!:)
Title: Re: Doble-sided material
Post by: robotmats on 2014-10-20, 15:16:36
This question has been on my mind since I first decided to try out Corona, that since it's been on my mind ever since Chaos Group introduced the 2-sided material for Vray. Why you ask? Well, becuase Vray's 2sided material isn't accurate! It does not render the way a real life flat, translucent material would do (i.e. a sheet of paper or a leaf).
I wrote a rather lengthy post about it at the Chaos Group forum: http://forums.chaosgroup.com/showthread.php?69901-The-2-sided-material-real-life-study-vs-the-rendered-version . If you don't have access to the site, I could probably repost it here, if you want.

I REALLY hope Corona can implement this, because it would enable us to render foliage (and more) in a much more realistic way.

By the way, I was not able to get a correct result using the Corona front/back-map. But who knows, maybe I'm missing something? :)
Title: Re: Doble-sided material
Post by: Juraj on 2014-10-20, 15:31:35
I wrote few of such essays too :- ) I just couldn't believe they can defend the "correctness" of that mat for vegetation by using arguments like "it's correct, it's energy conservation"; like that's all you need. They always approach everything from some strange, distanced technical view, where they can't look outside of the code and simply compare it to real-world.
What issues do you have with front back map ? I sort of like the approach, on one side you do have to put it multiple times to dif/gloss/bump slot, which is less convenient that two materials, but on other had you manage the translucency inside single shader which compensates for it.
But I didn't study it far too deeply to see shortcomings, or what's functioning differently than it should.
Title: Re: Doble-sided material
Post by: robotmats on 2014-10-20, 18:25:12
Hehe nice to hear it. I think Vlado understood the problem eventually, but so far, no fix has been applied.

From a workflow point of view, the 2sided material works nicely. If you look at a leaf, the front and the back side will have completely different properties - the diffuse color and reflection/glossiness will be the most apparent ones. Just setting up each side as a separate material, then dropping them in a 2sided mat to add the translucency is a great idea. With front/back map, you will have to do a lot more tweaking within the material. Also, being able to simply switch between different front and back materials is easy when using the 2sided mat.

The main issue with the example in the thread over at Chaos, is that the backlit side isn't shown correctly on the other side. Also, when setting the material to the "correct" level of translucency, the material is significantly dimmed when lit from the front. Alas, this works exactly the same way in Corona. When setting a map in the Translucency slot, the material front side is dimmed, the higher you set the Fraction amount. This is not what goes on in reality. A thick piece of paper and a thin paper will look exactly the same when looked at on the lit side, but the backside of those two papers will differ a lot.

I tried to find articles explaining the way light is dispersed and reflected through leaves. (I made a thread about that on Chaos aswell haha!) I found this article, which I think is rather interesting, though I haven't set out to understand the maths of it. http://www.photobiology.info/Jacq_Ustin.html

I would imagine a perfect double sided material to work in the following way:
• Each side maintains the diffuse/bump value independently from each other
• Each side maintains the reflection/specular value independently from each other
• A translucency value directs how much of the incoming light that transmits through the object - a fill color should also be added, to simulate e.g. chlorophyll

Also, to look real:
• A fully translucent material should look the same as a non translucent one when lit from the front
• A fully translucent material should never look dimmed or darker than its back side

These points are open to debate and improvements. :)

Now, I totally see the issue with energy conservation here, and since I'm no mathematician/programmer, I can't say how to solve it. As an artist however, I can say when something doesn't look right, and so far, the double sided solutions for vray and corona are not right. ;)

(I wonder if what rendering software lacks is correct absorption and transmittance of light within objects?) 
Title: Re: Doble-sided material
Post by: Ludvik Koutny on 2014-10-20, 20:48:51
Actually, that's wrong. The material should get dimmed, because it passes some energy through instead of reflecting it back to camera.

In some very early versions, Corona actually did not have translucency energy conservation, so when you added translucency amount to CoronaMTL, it actually added more energy to the material, without compensating it anywhere. So material reflected same amount of energy, but also started to transmit some more energy through. You have no idea how incredibly ugly it looked. Enabling translucency on grass for example made grass appear glowing. It was that super bright super green radioactive green color, like you can see in The Simpsons.

EDIT: I was trying to find the image, but it was way too long long ago. But it would be a nice example to scare you away from your idea. You really can't imagine how ugly glowing grass looks.

So back then, my workflow was to first create my materials, and then i would have to go to bitmaps, and reduce their RGB to half to compensate for it. Basically, i had to do manually what Corona now does automatically, just to make grass look realistic.
Title: Re: Doble-sided material
Post by: Ludvik Koutny on 2014-10-20, 20:55:47
Actually, you can try how it'd look yourself. Simply compensate for energy loss using output node for example. So if set translucency fraction to 0.5 for example, then add output node right before your diffuse map, and set RGB Level to 2.0 ;)
Title: Re: Doble-sided material
Post by: Juraj on 2014-10-20, 22:28:21
I don't have much energy to dive back into this topic, but up until now, I liked the Maxwell thin-sss solution best. It might actually be still quite basic translucency, but it behaved amazingly when I did vegetation for Ronen's competition.

But from pure empiric standpoint, Corona's translucency works wonders for me compared to where I was able to get with Vray2sided. I am quite satisfied with how far I can keep very nice specularity/translucence ratio.
Title: Re: Doble-sided material
Post by: robotmats on 2014-10-21, 12:02:09
Actually, that's wrong. The material should get dimmed, because it passes some energy through instead of reflecting it back to camera.

Well, there is the problem. What goes on, in real life is that the surface absorbs all light, it then scatters within the object, before exiting the object. The light that exits the object either goes 100% back to the surface (no translucency) or 50% back (full translucency). The value in both vray and corona for full translucency (within thin objects) can never occur in reality, because the backside of the object becomes brighter than the lit front side.

As I said before, my view is that of a 3D artist, and not a programmer, so I'm sorry I can't explain it better. What I did in the discussion with Chaos Group was to set up a real life study, and then try to recreate it in rendering. So far, all attempts have been unsuccessful. ;)
I've set up a similar scene for Corona, which I'm including to this post. The setup there is just to illustrate the different translucency values 0, 0.5, and 1, and how they look when lit from the front, and the back.
I'll also include a photo I took of how things look in reality. From a rendering point of view, I think it's interesting to note that a thick stack of paper will look exaclty the same as a single sheet of paper, when lit from the front, even though the stack lets hardly any light through.

I hope someone manages to beat me here - I'm not here to prove Corona wrong, just for the sake of it - I'm just here to shed som light on the problem, and try to find a solution.

The .rar-file contains a max2015 file with the scene, and the textures used. The weird black line in the render is simply the corona light seen from behind. ;)
Title: Re: Doble-sided material
Post by: robotmats on 2014-10-26, 17:14:22
Well well... what do you know! I gave it some further thought, and managed to solve the problem.

I took the front and back map, multiplied them with a composite map, adjusted the brightness with an output map. Adjusted the brightness of the front and back diffuse maps (to counter the dimming that occurs when using translucency).
The best Fraction value seems to be 0.45. Going higher makes the front side darker than the back side, which never(?) occurs in reality.

Conclusion: You can really make this work in Corona. Gonna make an attempt to create some nice leaves...
Title: Re: Doble-sided material
Post by: Timm Dapper | Laubwerk on 2014-10-27, 13:49:23
Hi everyone,

I just stumbled into this thread while doing my research to add Corona support to Laubwerk Plants. There are a few things that I am not sure about and perhaps you folks can help me clear it up. Mainly I am wondering if it's really the case, that all surfaces in Corona (at least for 3ds Max) are automatically single sided and to make them double sided, I have to use a special texture. And if I use that texture the materials automatically turn two-sided? Does the Two-Sided texture have to be in a specific slot for that to work?

Also I am wondering, the translucency section of the CoronaMtl has a "Level" setting, which I guess controls how much light from the back shines through and a Color setting with texture (which I'd expect to be the color that actually shines through). We usually have a texture that controls how much light comes through (which would define the vein structure and as a color texture would also allow a tint of the color from the back). Furthermore the color that actually shines through would, in our case, probably be the color of the texture for the other side of the leaf.

Now I am wondering, it seems that the "Level" settings can't be controlled with a texture, which feels a bit weird. Furthermore when applying the TwoSided texture to the color channel (like it seems this thread suggests I should do as well) would mean the front texture slot would actually have to contain the back side texture and vice versa, wouldn't it?

Does anybody here have a minimal example of how such a setup would look?

Best
Timm
Title: Re: Doble-sided material
Post by: Ludvik Koutny on 2014-10-27, 13:59:11
Hi everyone,

I just stumbled into this thread while doing my research to add Corona support to Laubwerk Plants. There are a few things that I am not sure about and perhaps you folks can help me clear it up. Mainly I am wondering if it's really the case, that all surfaces in Corona (at least for 3ds Max) are automatically single sided and to make them double sided, I have to use a special texture. And if I use that texture the materials automatically turn two-sided? Does the Two-Sided texture have to be in a specific slot for that to work?

Also I am wondering, the translucency section of the CoronaMtl has a "Level" setting, which I guess controls how much light from the back shines through and a Color setting with texture (which I'd expect to be the color that actually shines through). We usually have a texture that controls how much light comes through (which would define the vein structure and as a color texture would also allow a tint of the color from the back). Furthermore the color that actually shines through would, in our case, probably be the color of the texture for the other side of the leaf.

Now I am wondering, it seems that the "Level" settings can't be controlled with a texture, which feels a bit weird. Furthermore when applying the TwoSided texture to the color channel (like it seems this thread suggests I should do as well) would mean the front texture slot would actually have to contain the back side texture and vice versa, wouldn't it?

Does anybody here have a minimal example of how such a setup would look?

Best
Timm

Hi,

1, All materials in Corona are by default (at least in max version) double sided. By that i mean shading. Twosided texture is a tool to make something different texture appear on each side of the material. So for example you can use it to have one side of polygon more reflective than the other, or have one side of the polygon red, other one blue, and so on. In case of tree leaves, you can use it to have one side of leaf to have different color than the other, as it usually occurs, and to have top side more reflective and glossy than the other one, if you use twosided map also in reflection and glossiness slot.

As for the mapping of Level parameter. This was fixed to be consistent with other renderers (Mental Ray, Vray, etc...) in latest Corona version, but the fix is not publicly available yet, so you may want to postpone your effort of supporting Corona until these changes are made public. The old scheme, you are currently using, is using luminance of the texture in translucency color to drive amount of translucency, and color to drive color itself. So as a workaround, you could make translucency texture very contrasty, and then desaturate the texture a bit to compensate for saturation increased by increasing texture contrast. Although i would still suggest to wait a little until new C4D and Max version with correct translucency scheme that has mappable level parameter.

The usual setup would be to just take twosided texture, plug top side texture of leaf in top slot, bottom one into bottom slot, then plug this twosided texture in both diffuse and translucency color slots, tweak translucency level parameter to define ratio between diffuse and translucency, and then do the rest (opacity, bump, reflection and so on).