Chaos Corona Forum
Chaos Corona for 3ds Max => [Max] General Discussion => Topic started by: romullus on 2014-06-20, 16:26:43
-
I was making some foliage textures for personal use recently. Saved all maps to png format and begin to construct material. Soon enough i found that my material performs rather poor in therms of speed. Naturally, i blamed opacity map. Tried different tricks, but nothing really helped. So i decided to resave opacity texture to other format and to my surprise, i saw significant improvement. All other formats rendered much quicker... all except png and gif. Later i found out that transparency in those formats is what causing problems. But most interestingly is that gif saved without transparency shows massive improvement in render speed! So from now on, i'll use gif for opacity maps exclusively.
-
this is interesting, can you send me this particular scene and the maps so I can run some tests?
-
Done!
-
Now that's something interesting!.
Good to know.
-
very useful , thank u
-
Curiouser and curiouser.
-
thank you for this, very useful
-
maybe this is because the informations in those formats , for example you will lost a lot of data in GIF file or u have more data in PNG file (RGB+alpha) somthing like this :
PNG(8bit) > BMP(8bit) > GIF
-
if you are interested in further testing, try comparing PNG with and without comprimation, as well as with and without interlacing...
I think the difference why it performs this way for each format is inherently in file format structure itself. Gif uses structure that can be read as 1 pixel at a time and does not relly on decoding other parts of file (with the exception of instructions). So my guess would be that it saves time by reducing the need for buffer. And maybe I am completely wrong
-
If max REALLY decodes the original compressed format every time a texture is accessed, then I need to write CoronaMap ASAP.
-
If max REALLY decodes the original compressed format every time a texture is accessed, then I need to write CoronaMap ASAP.
that's another great news Keymaster
i was supposed to ask this question today mean while i saw this .. great
-
Definitely stirred my curiousity. I don't think there's way to measure this as easily in other renderers, to definitely pinpoint this as 3dsMax fault ?
And if so, I echo Tweekazoi's plea: Compare PNG based on comprimation (with and without), or alpha channel.
With Vray, I use purely .png for some sort of stuff(like foliage :- D), usually without comprimation, although over the time, I can't really remember if all of them are so.
-
I don't know what that comprimation is, you talking about, i guess it's compression, right? Anyway, i did some more tests as requested. Everything is saved from photoshop, source file doesn't contain any layers nor alpha channels (gif and png doesn't support alpha channel anyway). Bmp is provided for reference.
Results are quite confusing, at least for me:
-
I never ever used opacity from alpha. Always from an 8bit bitmap without alpha channel, so that's why i probably never ran into this issue.
I think that results of those tests are not confusing at all. They are actually quite simple to figure out. Best way seems to be using 8bit opacity maps without any alpha channel.
-
Rawalanche, all these maps are 8 bits without alpha channel.
-
Rawalanche, all these maps are 8 bits without alpha channel.
Then what's that transparency off/on? O_o
-
It's an option in photoshop "save as..." or "save for web..." dialog. But as i stated earlier my source file don't have alpha channels.
I can give you two gif files. One is saved with transparency "on", other with "off". Both have very similar file size and are indistinguishable in ps, but gives very different results when used as opacity maps.
-
Can you test it also with vray/scanline/mental ray?
-
scanline/mr - yes, i'll do it later, but i don't have vray.
-
Oh, no, that IS alpha i believe.
The only thing is that Photoshop interprets it as transparency for some formats. Simply because it's easier to explain to non technical users that something is transparent, than that is has an alpha channel they may never heard about.
Here's for example what you get when you save PNG out of max:
(http://i.imgur.com/hMtB8eM.png)
So, everything actually makes sense. Opacity is very, very expensive calculation. It does not just calculate some effect of a material. It calculates if ray has to evaluate the surface or pass through as if nothing happened. And that often happens more than once in a ray path. So any overhead in this very expensive and very often performed calculation will result in a significant slowdown.
Larger bit depth (16bit) = more data to process
Additional channel instead of standard RGB = more data to process
So it actually makes sense.
I usually use just JPEGs for my opacity maps. There i am sure it can not carry high bit depth nor it can carry any sort of alpha/transparency channel. That's probably why i never ran into any problems.
-
If max REALLY decodes the original compressed format every time a texture is accessed, then I need to write CoronaMap ASAP.
+ for CoronaMap
Edit : i think this is why Arnold created .tx format for textures :
(http://i.imgur.com/bzFEJdt.jpg)
https://support.solidangle.com/display/AFMUG/Textures
-
I was asking about the above chart only as well. Sorry if my word for compression was confusing, I don't know why I stuck with it.
Basically, 8bit (per channel, so RGB24) with/without Alpha channel and 16bit(RGB48) with and without Alpha channel.
And those, with and without compression. But you already proved compression doesn't matter. Good to know. So it all seems to be about bitdepth and alpha channel
I guess we're talking purely about opacity slot right now right ? If so I use 8bit/without alpha, but I still keep the diffuse one as 8bit with alpha (might be pure bullshit, but even if that alpha isn't used, I've noticed better result in Vray? )
Maybe I should give it a try and replicate in Vray.
-
The results of this test is geting ridiculous. I don't have much technical knowledge nor my english is good enough to feel comfortable in such discussion, so i'll leave you with plain numbers. Just a little explanation: i used 2 gif images as opacity map, both saved in photoshop via "save as..." dialog. One of them has transparency enabled, other hasn't. All materials are simple lambertian mats with only map in opacity slot (cutout in case of MR).
p.s. this is not comparison between renderers in terms of speed!!!
-
You guys use unfiltered maps for opacity right? Or doesn't filtering play any role in this?
-
Filtering of opacity maps is disabled in Corona by default.
-
To add to a confusion even more, i found that pngs saved in PS via "save as.." dialog, have negative impact on render speed, when used as normal maps too. It's not so huge as in case of opacity maps, but quite significant. Diffuse maps seems is not affected by that plague.
Definitely there's something fishy going on between photoshop and 3ds max. Don't know how you guys, but from now i'll try to stay away from pngs as much as possible :/ Tiff is much safer option, i think.
-
Bravo Romulus
This test and "interesting"
Regard
Raf
-
Looks like Rawalanche was right, it is alpha channel. Still, i don't know why 3ds max treats files, that don't have transparency info in it, like that.
-
Hard to tell... 3ds Max does a lot of things in a weird fashion.
It would be interesting to test all the different file formats in 8bit depth and without alpha channel. Just to be sure there's no performance gain or loss aside from additional channels or extended bit depth :)
Maybe even test formats which can store just monochromatic data (gifs for example).
-
Thanks this helps a lot, I will now focus on making JPEG's instead of PNG's
-
Ok, here's my latest findings.
What's influencing render time:
bit depth - has no impact
image compression - has no impact
additional layers and layer compression - has no impact
channels - does big impact:
RGB - normal render time
RGBA - time penalty
grayscale, indexed colours - huge bonus
All tests was done in Corona, with tiff file format in opacity map. I may do further tests with MR and/or scanline later.
-
I am actually curious if this is just behavior of TIF, or other file formats as well :) Max does not use one universal plugin to handle image formats. Instead, it has different plugins for different formats of varying quality.
So i would first make sure if this is general behavior, or only TIF format related behavior :)
-
Yes, it's translates to other formats that support alpha channel and/or single channel options.
-
ok, I dont have time to investigate this right now, maybe in 2 weeks ;)
-
I see...
Anyway... thanks a lot for these tests. I know very well that objective testing takes a lot of patience and time. So not many people take their time to systematically test something, but almost everytime someone does, they discover something either very useful, or some severe bug, which when removed, speeds up or improves quality of Corona a lot :)
-
That's interesting, i found that it's related to filtering. If i set texmap filtering to "all" - difference in render time between RGB, RGBA and monochrome, completely disappears.
One additional finding is that standart material's opacity map isn't affected by texmap filtering in Corona settings. I'll report that as a bug.
-
Sorry for reviving this topic, but I haven't seen any changelogs for some of things being fixed? And I am curious of all this is the same scenario when using .tga files compared to gif/png ?
Thanks guys! interesting find for sure.