Jump to content

Difference between PBR material and standard material with reflections ?


dsman
 Share

Recommended Posts

Hello,

About the reflection only, for a fully reflective and smooth surface like a mirror, you could achieve the same result with both materials.

But, here is the list of what the PBR bring on top of the standard material concening the reflection:

So basically, the reflection fits in a lighting model closer from physical light.

Your model could also simply be lit by the environment map (e.g. reflection texture) through this system. The following PG does not have any light and you can see a fully white sphere both with standard (black cause the environment does not lit it) and pbr material (impacted by the color of the environment around).

http://www.babylonjs-playground.com/#1P98HI#4

If I understand well, you are planning on using the reflection probes which are not integrated with Environment Irradiance or Seamless CubeMap. You then would not see a lot of advantages on using the PBR (on the reflection side only).

Please, do not hesitate if you need more information.

Link to comment
Share on other sites

@Sebavan  Thanks for reply. 

So if I understand correctly, everything from reflection to irradiance and zero-light,  depends on cubemaps. 

So can't PBR in babylon do everything (reflection, irradiance) based on live scene that is being rendered? Without use of cube maps ?

Link to comment
Share on other sites

The main issue is time (16 ms).

I had to create an extension to preprocess and binary pack cube map cause extracting information and preprocessing it takes around 1 minutes (on only one core) for 256 size on a good machine...

About irradiance It is faster but still way too slow to do each frame.

I think on some use cases where the scene is mostly locked apart from cam / player, we could probably do something (this would only slow down the loading). I am actually trying to see how to make the whole process easier and faster.

Link to comment
Share on other sites

Well , What if it could be something like reflection probe. Where we can set the frequency of update (update after x frame) ?

Or can we render some sort of map from babylon at runtime (at whatever frequency we want) into jpg binary and use that as cubemap for PBR material for reflection/irradiance ?

Link to comment
Share on other sites

@Sebavan Thanks for replying to my stupid question . But pardon me , I am beginner. Will you help  me understand different between cubemap and reflection probe  ? 

 

In your post above you said you can help adding it inside reflection probe. How will that work I mean. The way I understand it reflection probe are for reflection. It has nothing to do with Cubemap and PBR material's reflectivity and irradiance. 

 

Link to comment
Share on other sites

Hello,

Basically a cubemap is like having six images representing each face of a cube. The reflection use them to display whatever pixels are at the reflected position in this cube (skybox like).

cube_map_final.gif

If a model is enclosed in the cube above (once folded), you could compute the reflected pixel through the following formula (incident angle from normal = reflected angle) :

reflection_small.jpg

A reflection probe dynamically creates such faces from your running scene. Basically, instead of using a static environment, you could use a dynamic one created from a point in your current running scene. In the following example you can see the moving element being reflected and this could not happen with a static cubemap.

http://www.babylonjs.com/Demos/RefProbe/

To compute the environemnt irradiance, you need to loop and compute with expensive maths CPU wise (when you got only 16 ms), a kind of FFT over all the pixels to extract the probability of having one particular color at a particular point ("kind of" averaging the colors of all the neighbours pixels).

http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter10.html

So if you first render your scene from six angles and then apply the maths to extract the environment irradiance from the generated cubemap, your kind of hammering the performances. It is why doing it at the scene load (if the environment is static) could be ok. Another trick loosing a little bit of accuracy would be to compute the irradiance form lower mips of the generated cubemap to process less pixels. Tradeoff from efficiency to quality would have to be customizable (basically cubemap size, mip generation...).

Seamless Cubemap is definitely a no go because it is way too slow to preprocess correctly, webgl2 will help a lot on this (native seamless cubemap filtering can reach closer result without preprocess).

Do not hesitate if I am still not clear,

Link to comment
Share on other sites

So basically reflectionprobe can give us 5 surface cubemap that can be used as reflection texture in PBR material ? 

I noticed every Play ground of PBR is using  HDRCubeTexture, like shown below

 // Environment Texture
    var hdrTexture = new BABYLON.HDRCubeTexture("textures/room.hdr", scene, 512);

.
.
.

var plastic = new BABYLON.PBRMaterial("plastic", scene);
	plastic.reflectionTexture = hdrTexture;

.
.
.

 

So instead of this we can use cubemap generated every few second or every few frame from reflection probe ? 

Can you outline how to achieve this ? 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...