Forum

#1 2018-06-17 09:07:47

harryBardak
New member

Shader and renderer related question

Hi Guys,

It's Harry we met at the FMX this year, I am from Unit Image we were sitting next to you guys.
I met Cyril and Phillipe, I think. You guys invited me to try Guerrilla and here I am. I have downloaded the  2.0.19 for win10.


I would like to apology beforehand as some of my questions may sound stupid and others quite technical and thus boring.
I found the renderer quite capable, production oriented, and in my eyes very advanced. This is a very good piece of software !!!!

All my shading question are physically based shader question.



Let start with a stupid one :
About env_lights, how can make the renderer to render the HDR map I have plugged to the light visible to camera rays?
I have noticed a hidden toggle but it affects only the viewport rather than the final render.
Am I missing something obvious?

Render Log  :
Is there a way to display the log of the render (maybe in a console, or somewhere in the UI )? I am very keen to have stats printed somewhere so I know what I am dealing with.
Abilities to write metadata within the file with this kind of stats will be awesome too.

Others Ui related questions :
When pressing F1 is there a way to not lunch internet explorer? It is a bit annoying could we open the default browser?

Shading :
I have noticed that you guys are dealing with Multiple-Scattering Microfacet BSDFs when using the metal slider in the surface2. This is great! I love it. When performing the furnace test I don't see any energy drop when using high roughness. Is there any particular reason to not have it on dielectric materials? Especially on rough refraction?

https://jo.dreggn.org/home/2016_microfacets.pdf as you can see in this paper ( I am sure you know it already ) you can lose up to 60% of the energy on high roughness.

By the way, I can see the range allowed for the roughness goes from 0 to 2.0. I don't get it why 2.0? I have read again the GGX papers and I can't see any value beyond 1.0 All others renderer stops at 1.0, the paper mentioned above the alpha term stops to 1.0. When I do a render with a roughness of 1.0 and 2.0 the difference is minimal(when multi scattering is enabled, otherwise you have an even greater energy drop). Did I miss something?

About SSS, I found the volumetric SSS is the way to go. Far superior to the one embedded in surface2 especially with thin volume. There is no noticeable drop in energy and is simpler to setup and control once the physics of shading is understood. This obviously required a more rigorous modelling on the interior part but it is worth the effort as you have a subtle effect on the surface that is hard to emulate with others techniques. When I was at Framestore we developed similar technique a few years ago and now it is applied to every kind render such as cloth or hair materials.

http://blog.selfshadow.com/publications … _notes.pdf

Any plans to replace the surface2 SSS by the volume2 one?

Mixing multiple maps :
I was wondering how to mix multiple maps within guerilla? Imagine you have a static texture and an animated map that need to be added ( subtracted, multiplied, etc ... ) together, how would you approach such task in Guerilla?

Same question with Ramp or others procedurals textures, how do you mix them?

Writing Shaders :
During the FMX, you guys showed me that you can write your own shader. Apparently in RSL. Where should I put my shader written?
There are surface and volume shader, Is there a way to write a texture shader such as the stripes,veronoi one? 


These were my questions after my first day with guerilla.
I really like the renderer, I am sure I will have more questions as I go.

Thanks, guys for this product, it is good to see such talent in France!

Harry.

Offline

 

#2 2018-06-18 16:03:34

Ben
Guerilla dev, the guy to hug

Re: Shader and renderer related question

Hi Harry,

That's a serious batch of questions here!
Let's go ...

harryBardak :

Hi Guys,

I would like to apology beforehand as some of my questions may sound stupid and others quite technical and thus boring.
I found the renderer quite capable, production oriented, and in my eyes very advanced. This is a very good piece of software !!!!

There are no silly question here wink

harryBardak :

About env_lights, how can make the renderer to render the HDR map I have plugged to the light visible to camera rays?
I have noticed a hidden toggle but it affects only the viewport rather than the final render.
Am I missing something obvious?

Globally, the visibility of objects is controlled by the connections to layers, but there is also a shortcut (Attributes > SceneGraph > Primary Visibility) which bypasses all layers. By default, all lights from the library have the Primary Visibility unchecked, thus will not be visible.

Note that concerning AOVs, lights are considered as emissive objects, and so the environment will be visible in the Beauty and the Incandescence AOVs.

harryBardak :

Render Log  :
Is there a way to display the log of the render (maybe in a console, or somewhere in the UI )? I am very keen to have stats printed somewhere so I know what I am dealing with.

The renderer logs into the Console, toggle it using menu View > Show/hide Console. By default, the renderer is pretty silent, but you may turn on some more logs using the rendering Settings. In the Passes view, Settings > Logs & Diagnostics. You can switch the verbosity from Informative to Diagnostics, and activate any diagnostic (texture loading, shape info, ...)

Also, you can turn on the rendering profiler, which will output info about where the engine spends time, and you can also turn on the rendering statistics, which will output general statistics, like amount of texture loaded, number of casted rays, and so on. These are logged at the end of rendering.

harryBardak :

Abilities to write metadata within the file with this kind of stats will be awesome too.

Sure thing, you can add metadata in the RenderPass > Render Settings > File > Meta Data attribute. Note that only EXR images have metadata.

harryBardak :

Others Ui related questions :
When pressing F1 is there a way to not lunch internet explorer? It is a bit annoying could we open the default browser?

Yep, just check the Preferences > Local Settings > System > Web Browser attribute. Note that when changing local settings, these will be saved into the .guerilla.conf file in your user directory when exiting Guerilla. So if you kill Guerilla, these won't be effectively sabved.


harryBardak :

I have noticed that you guys are dealing with Multiple-Scattering Microfacet BSDFs when using the metal slider in the surface2. This is great! I love it. When performing the furnace test I don't see any energy drop when using high roughness. Is there any particular reason to not have it on dielectric materials? Especially on rough refraction?

https://jo.dreggn.org/home/2016_microfacets.pdf as you can see in this paper ( I am sure you know it already ) you can lose up to 60% of the energy on high roughness.

Hey, glad you found that wink
This is a fairly tough subject, and we have an experimental RoughGlass shader using multiscattering as well. But the thing is it doesn't completely fit properly with the AOV system currently. That's a bit technical to explain in a forum post, though. Just so you know, we've carefully balanced the energy on the diffuse/sss with the Spec1, so the general case should be properly handled.



harryBardak :

By the way, I can see the range allowed for the roughness goes from 0 to 2.0. I don't get it why 2.0? I have read again the GGX papers and I can't see any value beyond 1.0 All others renderer stops at 1.0, the paper mentioned above the alpha term stops to 1.0. When I do a render with a roughness of 1.0 and 2.0 the difference is minimal(when multi scattering is enabled, otherwise you have an even greater energy drop). Did I miss something?

There's no actual theoretical limit to the roughness. We found that above 2, there were less roughness variation, and the 0,2 range was nice enough so small values would still be visible on the slider. Note that only the slider is limited to 2, you can still dial values above 2 in the text box.

harryBardak :

About SSS, I found the volumetric SSS is the way to go. Far superior to the one embedded in surface2 especially with thin volume. There is no noticeable drop in energy and is simpler to setup and control once the physics of shading is understood. This obviously required a more rigorous modelling on the interior part but it is worth the effort as you have a subtle effect on the surface that is hard to emulate with others techniques. When I was at Framestore we developed similar technique a few years ago and now it is applied to every kind render such as cloth or hair materials.

http://blog.selfshadow.com/publications … _notes.pdf

Any plans to replace the surface2 SSS by the volume2 one?

We already have productions going using volumetric instead of SSS diffusion. But, to be honest, the pure volumetric scattering demands quite a lot more setup (making sure that meshes are properly closed, ...) is much more intensive on rendering time (you'll need to heavily bounce inside the volumetric, epsecially on high albedo objects) and it's not very obvious how we should deal with albedo textures.

On the other hand, SSS diffusion is simple, fast and quite predictable in most situations. So, it's a deal of balancing between accuracy, simplicity and efficiency. But it's totally feasible to use volumetric here, instead of SSS.


harryBardak :

I was wondering how to mix multiple maps within guerilla? Imagine you have a static texture and an animated map that need to be added ( subtracted, multiplied, etc ... ) together, how would you approach such task in Guerilla?

Same question with Ramp or others procedurals textures, how do you mix them?

Right now, you can craft subshader networks, instead of using factory provided subshaders. Check the doc here for more info on that.

harryBardak :

Writing Shaders :
During the FMX, you guys showed me that you can write your own shader. Apparently in RSL. Where should I put my shader written?
There are surface and volume shader, Is there a way to write a texture shader such as the stripes,veronoi one?

We put the core of our master shaders into the library/SL/startup directory, which is sourced at startup. You can then reference these functions into SLBox shader node.

Note that each of the subshaders present in the library/attributes are actually SLBoxes, so you can create a new one, then write your RSL script and then save it to the library. You can also setup a custom/studio library and have these subshaders saved there. Check the TD Guide to see how to do that.

harryBardak :

These were my questions after my first day with guerilla.
I really like the renderer, I am sure I will have more questions as I go.

Thanks, guys for this product, it is good to see such talent in France!

Thanks!

Best,
Ben


Benjamin 'Ben' Legros
Guerilla developer
http://www.guerillarender.com

Offline

 

#3 2018-06-19 08:34:40

doubleailes
Guerilla dev, the guy to hug

Re: Shader and renderer related question

Hi Harry,
Glad to see here.

Here is a exemple of a simple shader code to blend maps for a typical pbr package like megascan or scanbox or substance.
Kind of stuff we use in Minuscule production right.

Code:

void pbrBlend(
    //mask 1
    float mask = 0;
    //texture pack A
    color DiffuseA;
    float RoughnessA;
    float MetalnessA;
    float NormalA;
    //textures pack B
    color DiffuseB;
    float RoughnessB;
    float MetalnessB;
    float NormalB;
    //ouputs
    output color Diffuse;
    output float Roughness;
    output float Metalness;
    output float Normal;


    ){
        //operation
        color Diffuse = mask * DiffuseB + (1 - mask) * DiffuseA;
        float Roughness = mask * RoughnessB + (1 - mask) * RoughnessA;
        float Metalness = mask * MetalnessB + (1 - mask) * MetalnessA;
        float Normal = mask * NormalB + (1 - mask) * NormalA;

}

Last edited by doubleailes (2018-06-19 08:35:39)


Philippe Llerena

Offline

 

#4 2018-06-20 16:49:09

harryBardak
New member

Re: Shader and renderer related question

Thanks for pointing me to the right direction.
I should have passed more time into the documentation.


Regarding  metadata, there is not much in the doc about the keyword you can use.
What would be the rendertime key ? what about the memory RSS peak ?

Ben :

Hey, glad you found that wink
This is a fairly tough subject, and we have an experimental RoughGlass shader using multiscattering as well. But the thing is it doesn't completely fit properly with the AOV system currently. That's a bit technical to explain in a forum post, though. Just so you know, we've carefully balanced the energy on the diffuse/sss with the Spec1, so the general case should be properly handled.

What do you mean ? Is it a how to determine if this ray is a glossy or refractive so it get output in the revelant AOV ?
Could you elaborate how do you handle the balance energy ? Are you implying that the lost of energy at high roughness is somehow compensated when you mix using the microfaset fresnel mask ?


Ben :

There's no actual theoretical limit to the roughness. We found that above 2, there were less roughness variation, and the 0,2 range was nice enough so small values would still be visible on the slider. Note that only the slider is limited to 2, you can still dial values above 2 in the text box.

I have always though that having the alpha term set to 1.0 will mimic a fully diffuse surface. I must be wrong.

Ben :

We already have productions going using volumetric instead of SSS diffusion. But, to be honest, the pure volumetric scattering demands quite a lot more setup (making sure that meshes are properly closed, ...) is much more intensive on rendering time (you'll need to heavily bounce inside the volumetric, epsecially on high albedo objects) and it's not very obvious how we should deal with albedo textures.

This is the whole point. If you want to reach realism on character, you will have to model things correctly ( from anatomy point of you ) as it will affect not only the shading but also the muscle dynamic, the volume concervation of your character. You do already all the work.
I am using this workflow for a the last 4 years and it brings character to an another level.
some example :
https://www.youtube.com/watch?v=JkqTeQHFoBY
https://www.youtube.com/watch?v=TGCLyeqlsZI&t=68s

Rendertimes with high density ( needed for Skin ) should not be too different from the current diffusion approach.

Concerning the parametirization of the albedo, I understand your concern and we faced the same issue. Ideally you want to make it artist friendly. I can help smile

http://blog.selfshadow.com/publications … _notes.pdf
section 2.4.2

The idea is to paint on the map the color you want and the shader will do all the internal work to remap theses wanted color to physical value that make sense for the shader.

We also published a paper about how to convert value from a color map to complex IOR ( n +k for r,g and b)


Concerning the SLbox, do you have a list of illumination model and/or function we can call ?


Thank you very much !

H.

Offline

 

#5 2018-06-20 21:32:23

Ben
Guerilla dev, the guy to hug

Re: Shader and renderer related question

harryBardak :

Regarding  metadata, there is not much in the doc about the keyword you can use.
What would be the rendertime key ? what about the memory RSS peak ?

Currently, Guerilla natively writes the following metadat in the EXR file:
comments = created with guerilla render #.#.#
worldToCamera = Matrix44f with the world to camera matrix (this doewn't account for motion blur, obviously)
focal = float with camera focal value
aperture = float with the camera aperture
filmOffset = float with the film back offset
empty = int that tells if the image has no pixel data
renderingTime = string with the total rendering time (something like 5.3s, or 10m23s, or 4h15m12s)
hostname = string with the name of the computer that rendered the frame.

Custom metadata are parsed as name=value pairs in the Metadata attribute of the render pass, and are written as is. We don't output other values for now, but logging the peak memory is a nice suggestion!

Ben :

Hey, glad you found that wink
This is a fairly tough subject, and we have an experimental RoughGlass shader using multiscattering as well. But the thing is it doesn't completely fit properly with the AOV system currently. That's a bit technical to explain in a forum post, though. Just so you know, we've carefully balanced the energy on the diffuse/sss with the Spec1, so the general case should be properly handled.

harryBardak :

What do you mean ? Is it a how to determine if this ray is a glossy or refractive so it get output in the revelant AOV ?

For the moment, Guerilla tests that it's worth sampling/evaluating a bsdf using a LPE token (like reflective diffuse, reflective glossy, ...) to avoid sampling a light that won't be contributing to the bsdf, so the engine won't behave properly if the actual bsdf token (like would happen with a MS glass bsdf) is not the declared one. But this is not a completely necessary limitation, and will be removed somehow.

harryBardak :

Could you elaborate how do you handle the balance energy ? Are you implying that the lost of energy at high roughness is somehow compensated when you mix using the microfaset fresnel mask ?

The missing energy from the microfacet shadowing term is compensated in the underlying diffuse/translucence/sss term. Something a bit similar to the Revisiting Physically Based Shading at Imageworks talk on the selfshadow blog post you mentionned (by the way, I attended this talk last year, it was a huge session!)

harryBardak :

Concerning the parametirization of the albedo, I understand your concern and we faced the same issue. Ideally you want to make it artist friendly. I can help smile

http://blog.selfshadow.com/publications … _notes.pdf
section 2.4.2

The idea is to paint on the map the color you want and the shader will do all the internal work to remap theses wanted color to physical value that make sense for the shader.

We also published a paper about how to convert value from a color map to complex IOR ( n +k for r,g and b)

That's definitely something we've started investigating. I'd love to propose something like this.

harryBardak :

Concerning the SLbox, do you have a list of illumination model and/or function we can call ?

Not a list, per se, but you can open the library/SL/startup folder a get a look at the surface2.sl. It contains the latest we have in store yet. Also the standard_inline.sl has some older bsdf functions in it, but is quite deprecated by now.

We don't provide yet a SDK for plugin bsdf closures right now, but I'm heavily refactoring things in the integrator, and I'm considering implementing all our current bsdfs as plugins.

Best,
Ben


Benjamin 'Ben' Legros
Guerilla developer
http://www.guerillarender.com

Offline

 

#6 2018-06-25 11:44:14

harryBardak
New member

Re: Shader and renderer related question

That was a great read thanks !
I have overlooked Sony's paper as they tends to repeat themself from years to years.
Ole Gulbrandsen started his working on mapping color map to physical value when he was at Framestore.
http://jcgt.org/published/0003/04/03/paper.pdf

Offline

 

#7 2018-06-26 06:42:04

Ben
Guerilla dev, the guy to hug

Re: Shader and renderer related question

Oooh, I never saw this paper, that's brilliant!
Thanks a lot!

"there must be an easier way to do this!" awesome!


Benjamin 'Ben' Legros
Guerilla developer
http://www.guerillarender.com

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2008 PunBB