Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - avl

Pages: [1]
1
[Max] Resolved Feature Requests / 'Add' shader/node/material
« on: 2016-08-29, 12:12:21 »
There is a layered material in Corona, which mixes several materials with weights.
It would be great to have an 'add' material/shader which just sums up material colors without weights.
While it breaks energy conservation, it's often useful, e.g. to fake dispersion.

Currently, it's unclear how to make a realistic (albeit fake) diamond material with dispersion in Corona.
The common way to fake dispersion is to sum up three glass materials for R,G,B colors with slightly different IORs.
If using a mixing layer, the result will be too dark (one third of required).
I also tried to multiply reflection/refraction colors by 3, but it gives strange tinted results. It's possible to find mixing weights which result in a neutral color, but it's quite difficult, and the result is still dark.

So, a proper 'add' material would solve this problem. Which is much easier than a full spectral rendering solution, and probably preferable from an 'artistic' point of view, since the real dispersion is rather weak and a fake one is more art-directable.

I attached corona mtl preview results, to illustrate the stuff above.
plain.png/plaint.txt - is a pain glass (IOR=2.4) material
dark.png/dark.txt - is a mix of three glass materials with slightly varying IORs and reflection/refraction colors set to red, green and blue
trippled.png/trippled.txt - is the same as previous. but color values are multipled by 3 (which is incorrect probably)


2
[Max] I need help! / Re: Linear Diffuse
« on: 2016-08-17, 11:06:11 »
I think you should read about Physically-Based Rendering stuff, e.g.
http://www.marmoset.co/toolbag/learn/pbr-theory
http://www.marmoset.co/toolbag/learn/pbr-practice

This will take some time, but definitely worth it.

3
2. using -mtlPreview the documentation says that writing \0 to the stream will trigger the render and leave the process running.  I can't seem to trigger that, it appears that closing stdin is the only way to trigger the render and it exits the process.
The problem probably, that an internal I/O buffer is not flushed. E.g. \0 resides in a buffer and Corona haven't seen it.
Something like this should help, if using python (can't test right now the code, but the idea should be clear)
Code: [Select]
a = subprocess.run(['Corona_Release.exe', '-mtlPreview'], stdin=subprocess.PIPE)
a.stdin.write('0.3 200 200 test.png\n')
a.stdin.write('<material class="Native"><diffuse>0.8 0.8 0.8</diffuse></material>\n\0')
a.stdin.flush()

6
[Max] I need help! / Re: Physically correct materials
« on: 2016-07-27, 19:59:24 »
My current method is:
1. I choose a reflective curve of a material I want to create.
2. I represent this curve in fallof map that is put in the reflective (fresnel is off).
3. I'm trying to eyeball correct setting for GGX (GTR tail fallof) but im not sure what i'm doing there, what to type in there.
I do not blend materials with different gloss. already since i heard that GGX can do this for me. But i'm still trying to re-create the propper fresnel. Is that method ok?

Unfortunately, this won't re-create the proper Fresnel, unless glossiness = 1.0 or so.
It's far from easy to explain why it's so, but I'll try.

The problem is that micro-facet models (including GGX one) use Fresnel a bit differently.
Fresnel equation/curve assumes a perfectly smooth material.
Micro-facet models assume there a lot of micro-facets, oriented differently, i.e. their normals differ from the surface normal, according to some distribution (e.g. GGX distribution).
And a micro-facet model integrates responses from the distribution of the micro-facets in some nontrivial way.
The main problem is the Fresnel effect is calculated using so-called half-vector (a vector in-between a light and a camera rays), not a surface normal vector.

So, it's sad to say, but one cannot re-create the proper Fresnel in many renderers for rough materials.
Basically, there is no way to access light rays directly in a typical path-tracing renderer node system.

Some renderers implement micro-facet models in a "separable" way, i.e. they completely ignore the Fresnel term during light integration and multiply by a "smooth" Fresnel term later (using normal vector). Which works okay for a glossy case, but results in a noticeable unnatural rim in a rough case (glossiness = 0 or so).
This cannot be easily solved with falloff maps and so, since a proper implementation will use a different Fresnel curve for different light rays, roughly speaking.

So, a typical solution is to adjust GGX parameters (possibly with some curve/map) or even mix two GGX materials in some way, so that it looks plausible.
And this is unlikely to change, since it's non-trivial to implement a flexible solution. Ideally, there should be a dielectric GGX implementation and a metal GGX implementation, and probably a separate tinted-metal GGX implementation :). With enough parameters to calculate proper Fresnel curves during light integration.

Hope my explanation will be helpful, but generally speaking it's a quite complicated matter (I've spent lot of time to figure out what is the problem with the crazy rim effect for rough materials)

7
[Max] Resolved Bugs / Corona Standalone -mtlPreview crash
« on: 2016-07-08, 11:57:02 »
Corona standalone crashes when run with -mtlPreview option.

For example
Code: [Select]
E:\Corona Standalone\2016-04-10>Corona_Release.exe -mtlPreview
License info:
Demo license active.
Activated until: 2016-07-18

0.3 100 100 test.png
<materialDefinition name="test"><material class="Native"><diffuse>0 0 0</diffuse></material></materialDefinition>
^Z

I use the latest Corona Renderer - Standalone, version: 1.4 DailyBuild Apr 10 2016

Pages: [1]