Chaos Corona for 3ds Max > [Max] Feature Requests

Transparent pixel rendering...

(1/4) > >>

Naxos:
Hello there,

As some may know i'm a lot involved in "configurators" projects, where i render a lot of PNG rgba files to let the final user choose colors for a product
http://configurateur.billard-toulet.com/

As you may have noticed, in some color cases, dark on dark, or light on light, for ex. we get an awfull contour, due to the arbitrary 128grey choice for the background (best fit for all-case solution)...
Let me show you some quick tests :

dark on dark effect - 128grey background


light on light effect - 128grey background

What would be great is to be able to "render" transparent pixels... Sort of premultiplied alpha, but not during the saving picture process (it already exists when PNG is used for ex.),
but the Photoshop-way :


Screenshot of the photoshop "draw - onto - transparent pixels"...


... and pasted onto my background picture...

Now let's speak about coding this one : i'm not a coder guy, but my logical think about it would be :
I'm the CPU, i'm rendering the picture... For that pixel being rendering, what's about alpha : is it black or is it white ? (or grey)...
If the alpha is white, ok then i go on rendering it...
If the alpha is 100% black, ok i ignore it and set this pixel to transparent... Really transparent, not letting the 3D background / direct visibility override color...
If the alpha is somewhere in between, ok i write the premultiplied alpha value onto it, again not on the background / direct visibility color, but on transparent way...
Just like Photoshop does when we draw on empty layer...

That would prevent contour, and more than that, that would maybe speed up the rendering of the scene, because black-alpha-ed pixels would be ignored...

What do you think of that ? Is it possible ?

Fluss:
This is a premultiplication/unpremultiplication issue. For compositing purpose, you should always render on a black background. Then, unpremult -> grade -> premult.

Look at this :

http://www.schoolofmotion.com/premultiplication-demystified/

AND

Naxos:
Very interesting tuto, thanks...

But it is not really what i need, since i don't grade anything, just i'd like to get rid of contour right outside the box after render...

Here is a test within a black background, and we still see dark contour, no grade, no change : just render and apply onto back picture...

3dsmax / Corona premultiply the alpha with PNG output, but i can't find the "Straighten alpha" the tuto is talking about...



Fluss:
PNG automatically premultiply alpha, so you get part of the background in the antialiased areas. If you want to get rid of this, you HAVE TO comp your render over your background in post and tell your compositing package you have rendered a premultiplied image over a solid background (and specify that background color for removing the premultiplication from the color channels).

Naxos:
problem is that i manage several png layers, containing from dark to light objects...

That is why the Photoshop-like transparent background is needed, i can't use any arbitrary background except a 128grey as a medium-range one...

Navigation

[0] Message Index

[#] Next page

Go to full version