Author Topic: Polygon Selections and Embedded Alpha  (Read 7392 times)

2014-10-26, 21:57:48

Timm Dapper | Laubwerk

  • Active Users
  • **
  • Posts: 14
    • View Profile
    • Laubwerk
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:

  • We are using polygon selections to assign different materials to different parts of the plant (and also to switch materials as seasons change). It seems like Corona for Cinema 4D doesn't support assigning materials to polygon selections. I attached a simple test scene that shows the effect.
  • We are using an images embedded alpha channel to cut out the leaf shapes. It seems like there is neither a switch to use the embedded alpha in a texture (that's the way the Cinema 4D material does it) nor does Corona support the layer selection (which would let me choose the Alpha layer explicitly in the Bitmap Shader).

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


2014-10-27, 11:47:01
Reply #1

Timm Dapper | Laubwerk

  • Active Users
  • **
  • Posts: 14
    • View Profile
    • Laubwerk
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).

2014-10-27, 12:10:53
Reply #2

minimaldesign - Blaž

  • Active Users
  • **
  • Posts: 143
    • View Profile
    • minimaldesign

2014-10-27, 12:54:29
Reply #3

Ludvik Koutny

  • VIP
  • Active Users
  • ***
  • Posts: 2560
  • Just another user
    • View Profile
    • My Portfolio
"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 ;)

2014-10-28, 14:56:29
Reply #4

alekba

  • Active Users
  • **
  • Posts: 27
    • View Profile
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.

2014-10-28, 15:30:29
Reply #5

Timm Dapper | Laubwerk

  • Active Users
  • **
  • Posts: 14
    • View Profile
    • Laubwerk
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
« Last Edit: 2014-10-28, 16:43:03 by Timm Dapper | Laubwerk »

2014-11-12, 18:58:09
Reply #6

Timm Dapper | Laubwerk

  • Active Users
  • **
  • Posts: 14
    • View Profile
    • Laubwerk
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

2015-02-26, 19:50:05
Reply #7

Timm Dapper | Laubwerk

  • Active Users
  • **
  • Posts: 14
    • View Profile
    • Laubwerk
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.
« Last Edit: 2015-05-10, 12:46:37 by Timm Dapper | Laubwerk »

2015-02-27, 09:30:33
Reply #8

Allertaler

  • Active Users
  • **
  • Posts: 50
    • View Profile
Thanks alot, Timm!

2015-02-27, 17:28:17
Reply #9

Nejc Kilar

  • Corona Team
  • Active Users
  • ****
  • Posts: 1096
    • View Profile
    • My personal website
Kudos from my side aswell ;) Thanks!
Nejc Kilar | chaos-corona.com
Educational Content Creator | contact us

2015-02-28, 12:31:23
Reply #10

4b4

  • Active Users
  • **
  • Posts: 156
    • View Profile
Cheers Timm, very helpful

2015-05-10, 12:45:47
Reply #11

Timm Dapper | Laubwerk

  • Active Users
  • **
  • Posts: 14
    • View Profile
    • Laubwerk
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