Author Topic: Material Efficiency question...  (Read 9032 times)

2016-09-05, 19:20:05

Njen

  • Active Users
  • **
  • Posts: 557
    • View Profile
    • Cyan Eyed
I have modelled an interior scene that has 47 UDIM tiles full of geometry. From a Corona standpoint, is it more efficient to have a single material with a single texture set that has 47 UDIM tiles assigned to all of the objects, or split it up into 47 different materials with 1 texture set per material?

From a set up and scene management point of view, a single material with 47 UDIM tiles is much easier to manage than 47 separate materials, but I was wondering if my renders are going to take a hit because of it.

Thanks!

[Edit:] In case anyone was wondering why I have so many tiles, I am pushing all of the geo through Substance Painter and each object needs its own unique dirt and edge maps.
« Last Edit: 2016-09-07, 02:52:39 by Njen »

2016-09-06, 13:55:03
Reply #1

Fluss

  • Active Users
  • **
  • Posts: 553
    • View Profile
What a specific question. I think you will have to test it out and compare the rendertimes to get an answer..

2016-09-06, 14:27:12
Reply #2

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 13697
  • Marcin
    • View Profile
What a specific question. I think you will have to test it out and compare the rendertimes to get an answer..
Either that or waiting for Ondra's answer.

By the way, how did you use UDIM with Corona? I remember there were some questions about this some time ago.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2016-09-07, 02:33:03
Reply #3

Njen

  • Active Users
  • **
  • Posts: 557
    • View Profile
    • Cyan Eyed
I can wait for the answer...I've got plenty of other things to keep me busy in the meantime.

I use the 'multiTile' map, but because the map only works automatically with the native 'bitmap' node, not the 'CoronaBitmap' node, I have to hook everything up manually instead:
* On the 'multiTile' map, set the 'File Pattern Format' to 'Custom'.
* Hit the button next to 'Number of Textures' the desired amount of times.
* Hook up a 'CoronaBitmap' to the first slot.
* Disable tiling in the 'CoronaBitmap'.
* Load in the first image tile. If your image has a number other than 1001, offset the 'u' and 'v' coordinates by the appropriate amount.
* Duplicate the 'CoronaBitmap' and hook it up to the 'multitile' map.
* Load in the second image tile, and offset the 'u' and 'v' coordinates by the appropriate amount.
* rinse and repeat...

The 'multiTile' map will correctly show the offsets made set the individual 'CoronaBitmaps', however, changing the offsets in the 'multiTile' map will do nothing (that only works with the native 'bitmap' map). It would be great if 'multiTile' can interact with 'CoronaBitmap' with all of the same functionality as the native 'bitmap', because then we don't have to manually hook up all of the individual 'CoronaBitmaps'. Or Corona will need to make it's own version of 'multiTile'.

I hope that all made sense.

2016-09-07, 09:18:33
Reply #4

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 9276
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Can i ask why do you choose CoronaBitmap instead native bitmap loader if it requires hugely more work to setup?
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2016-09-07, 09:43:32
Reply #5

Njen

  • Active Users
  • **
  • Posts: 557
    • View Profile
    • Cyan Eyed
I was under the impression that the CoronaBitmap loader has an edge of the standard one. Is that not the case? Is there no difference to I/O or speed in the two loaders?

2016-09-07, 11:48:13
Reply #6

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 9276
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Well, maybe there is, but is it worth such effort? You should ask yourself, which time you value more, yours or computer's?
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2016-09-07, 12:15:53
Reply #7

Njen

  • Active Users
  • **
  • Posts: 557
    • View Profile
    • Cyan Eyed
I'm rendering an 8 minute short film, that's roughly 11k frames. Even if it does speed up the render by only a tiny bit, for 10 minutes of setup time, trust me, every little bit is worth it.

2016-09-12, 13:22:04
Reply #8

Njen

  • Active Users
  • **
  • Posts: 557
    • View Profile
    • Cyan Eyed
Is there any comment on my original post?

2016-09-13, 18:30:29
Reply #9

Njen

  • Active Users
  • **
  • Posts: 557
    • View Profile
    • Cyan Eyed
So I went in and started to dig around myself, and it is starting to become clear to me that using an image mask that is not tiled increases the render time. Below I have posted a screen capture of my Deadline Monitor to compare data. The scene is an internal area with a number of reflective objects. I used the same material on all objects where I am mixing a dielectric-like material and a metallic-like material together using a 'CoronaMix' node. The node is being mixed by an image map in various locations written in each comment line in the screen capture.

What stands out to me is that all of the renders that use an image map that has 'Tiling Mode' set to 'Repeat Tiling' in both directions render a little faster than the non-tiled images.

Maybe this is obvious, but when I use 47, 2k tiles as the mix, the same render takes about 34 minutes. When I use a 'Checker' node as the mix, the render takes about 9 minutes.

There seems to be a lot of overhead when using tiles.

I guess the next test is to bite the bullet and split out 47 materials all using a single image each (tiled) to mix, and see if it renders faster than 34 minutes.
« Last Edit: 2016-09-13, 18:38:22 by Njen »

2016-09-14, 19:27:17
Reply #10

Njen

  • Active Users
  • **
  • Posts: 557
    • View Profile
    • Cyan Eyed
Ok, so I can confirm huge slow downs when using textures as tiled through the 'MultiTile' node. Read my previous comment for a better description of the set up I am using. Having one material that has 47 tiles rendered in 34 minutes, and splitting all of the tiles into individual materials brought the render time down to 14 minutes. That's a massive time difference, and comparing the renders they look almost identical, with most of the difference being in the noise, which look mostly the same kind of noise.

I hope this goes down on the list of things to look into

2016-09-14, 20:14:47
Reply #11

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 9276
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Please make a bug report from it in appropriate forum board. That way you can be sure that this bug won't be overlooked..
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2016-10-03, 02:12:56
Reply #12

Njen

  • Active Users
  • **
  • Posts: 557
    • View Profile
    • Cyan Eyed
Oops, I forgot to put in a bug report...doing it now.

2016-10-05, 01:20:37
Reply #13

melviso

  • Active Users
  • **
  • Posts: 398
    • View Profile
    • Portfoilo
Ok, so I can confirm huge slow downs when using textures as tiled through the 'MultiTile' node. Read my previous comment for a better description of the set up I am using. Having one material that has 47 tiles rendered in 34 minutes, and splitting all of the tiles into individual materials brought the render time down to 14 minutes. That's a massive time difference, and comparing the renders they look almost identical, with most of the difference being in the noise, which look mostly the same kind of noise.

I hope this goes down on the list of things to look into

Interesting analysis. I have always thought about this too. What of if you had a very high res texture for all the udim tiles rather than the 47 tiles? Say u use a 32k texture or even higher. I am guessing this would take more time to render than if you broke the asset into UDIM textures? I would have to admit making 47 materials for one asset might get a little complicated if you need to revisit the said asset to make adjustments or changes. If I may ask, what software are you using for UDIM texturing workflow?

2016-10-07, 10:24:09
Reply #14

Njen

  • Active Users
  • **
  • Posts: 557
    • View Profile
    • Cyan Eyed
I thought about the high res texture map, it is an interesting idea.

HOWEVER!

I think I've found a work around for now which will allow me to work in a psuedo UDIM workflow while having fast renders. If I make sure that all of the texture faces in any given tile has the same material ID as the tile they are in, then I can use a 'CoronaMultiMap', set the 'Mode' to 'Material ID', and zero out any uv coordinate offsets, and it all seems to work.

If there are no glitches with this, then it will save me huge amounts of time, because I now have scenes with hundreds of materials (multiple assets using multiple tiles), and any tweaking was starting to get ridiculous as far as how much time it was taking.