Chaos Corona Forum

Chaos Corona for Cinema 4D => [C4D] General Discussion => Topic started by: Timm Dapper | Laubwerk on 2014-10-26, 21:57:48

Title: Polygon Selections and Embedded Alpha
Post by: Timm Dapper | Laubwerk on 2014-10-26, 21:57:48
Hi there,

I'm currently working on adding support for Corona to one of the next updates to Laubwerk Plants. There are two problems I am running into related to this:


Would be great if these issues could be addressed in an upcoming update. That would allow us to roll out Corona materials for all Laubwerk Plants in the next update, which would be really exciting for us! Keep up the good work!

Best
Timm

Title: Re: Polygon Selections and Embedded Alpha
Post by: Timm Dapper | Laubwerk on 2014-10-27, 11:47:01
Just as a quick followup. The problem does actually not show up for every model, but the ones that have it, seem to have it consistently. Let me know, if I can be of any help to get this figured out.
I attached a quick test render of a different model that doesn't have the problem (and I created separate alpha images for to work around the embedded alpha issue).
Title: Re: Polygon Selections and Embedded Alpha
Post by: minimaldesign - Blaž on 2014-10-27, 12:10:53
"C4d Corona is for brave ones now" :)
Title: Re: Polygon Selections and Embedded Alpha
Post by: Ludvik Koutny on 2014-10-27, 12:54:29
"C4d Corona is for brave ones now" :)

Yup, but that does not change anything on the fact Corona team should always do their best to help 3rd parties to support Corona ;)
Title: Re: Polygon Selections and Embedded Alpha
Post by: alekba on 2014-10-28, 14:56:29
It is nice that you develop  Laubwerk Plants for Corona, it takes some time for all things snap into place. One day when Corona for C4D becomes fully functional, it will be nice to have Laubwerk in toolbar.
Title: Re: Polygon Selections and Embedded Alpha
Post by: Timm Dapper | Laubwerk on 2014-10-28, 15:30:29
Thanks for the heads up! I already mentioned it in another thread: If you want to give the Corona material a try, we can pass you a beta version of our Plants Kit Freebie to test. If you're interested, let us know at support@laubwerk.com.

Best
Timm
Title: Re: Polygon Selections and Embedded Alpha
Post by: Timm Dapper | Laubwerk on 2014-11-12, 18:58:09
I think I figured out what's going wrong. When there is a texture tag, that refers to a named selection which doesn't exist on the object, CINEMA 4D doesn't apply the material at all (as I'd intuitively expect). The Corona plugin instead applies that material to all polygons. Would be great if that could be fixed in an update.

I attached a minimal example scene. It's just a box with two materials applied. The yellowish material has is applied to a names selection that doesn't exist. The viewport doesn't use it at all (as the CINEMA 4D renderer would), but Corona uses the yellow material for the whole box.

Best
Timm
Title: Re: Polygon Selections and Embedded Alpha
Post by: Timm Dapper | Laubwerk on 2015-02-26, 19:50:05
Hi forum,

just in case anyone is following this and has been trying to use Laubwerk Plants with Corona in Cinema 4D: I've created a script that, when run before kicking off a rendering, modifies the material assignments on Laubwerk Plant objects (and only there) in a way so it should successfully render. The script needs to generate the render geometry for every tree to determine which materials are actually used, so depending on the number of plant objects in the scene, it will run a bit. On the bright side: You will only have to run it if you added Laubwerk Plant objects or changed the species, variation or season settings. Hopefully this helps a few people until a Corona Cinema 4D update fixes this (which should be soon).

For everybody not familiar with Python Scripting in Cinema 4D, it is really simple to use this script:

Download the attached script and unzip it. To run it inside Cinema 4D, choose "Script" -> "User Scripts" -> "Run Script..." and select the extracted "Laubwerk Corona Prepass.py". To make this even easier, open the Cinema 4D script folder by clicking on "Script" -> "User Scripts" -> "Script Folder". This will open the script folder in a new Explorer/Finder window. Copy the "Laubwerk Corona Prepass.py" file there and restart Cinema 4D. After the restart, the script should be listed under "Script" -> "User Scripts" and you can start it directly from there.

Best
Timm

EDIT: The latest Alpha 2 version of Corona for Cinema 4D (https://corona-renderer.com/blog/corona-for-cinema4d-alpha-v2-released/) fixed the problem this script solves, so there is no need to use it any more.
Title: Re: Polygon Selections and Embedded Alpha
Post by: Allertaler on 2015-02-27, 09:30:33
Thanks alot, Timm!
Title: Re: Polygon Selections and Embedded Alpha
Post by: Nejc Kilar on 2015-02-27, 17:28:17
Kudos from my side aswell ;) Thanks!
Title: Re: Polygon Selections and Embedded Alpha
Post by: 4b4 on 2015-02-28, 12:31:23
Cheers Timm, very helpful
Title: Re: Polygon Selections and Embedded Alpha
Post by: Timm Dapper | Laubwerk on 2015-05-10, 12:45:47
Hi everybody,

your probably already noticed, but the latest update to Corona for Cinema 4D (https://corona-renderer.com/blog/corona-for-cinema4d-alpha-v2-released/) fixed this problem, so there is no more need for the script I posted above. Everything will just work.

Best
Timm