Jump to content

Missing Documentation For Deferred Buffers In 2.1.1


photo

Recommended Posts

Posted
Hi,
 
We are attempting to upgrade our codebase to Unigine 2.1.1 but our work has ground to a halt as we miss documentation explaining what each deferred buffer contains.  In previous versions of unigine this was well documented and allowed us to integrate our 3rd party render code.  
 
Are we looking in the wrong place or has this documentation not yet been written?
 
Specifically we are looking for info on : 
  1. What buffers are there?
  2. What does each channel contain?
  3. A brief description of how the above are used during the lighting pass?

Any help greatly appreciated.

 

Thanks!

Posted

Hi Ben,

 

Documentation is not yet updated, sorry. 

 

For #1 and #2 questions:

 Texture *deferred_depth;        //0 RGBA8   comprossed depth    (rgb)   alpha       (a)
 Texture *deferred_diffuse;      //1 RGBA8   diffuse             (rgb)   microfiber  (a)
 Texture *deferred_normal;       //2 RGBA8   comressed normal    (rgb)   gloss       (a)
 Texture *deferred_specular;     //3 RGBA8   specular            (rgb)   translucent (a)
 Texture *deferred_velocity;     //4 RG16F   velocity            (rg)
 Texture *deferred_decal_mask;   //5 R32U    decal_mask          (r)
 Texture *deferred_light_map;    //6 RGBA16F light map           (rgb)   occlusion   (a)

When I will have more information about #3 I will edit this post.

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Posted

Thanks for the quick response, this info help us understand the system a bit better, most of our remaining questions are related to alpha, eg : 

 

- What is alpha channel from depth buffer?
- If we don't use microfiber, what alpha value to put?
- Does velocity refer to motion blur? If so, what values to use for no motion blur, black?
- How is translucency used?
- If we don't have decals, should the decal values be black?
- Does occlusion refers to ambient occlusion? Doesn't Unigine compute this as post processing? When not using this, should I put white?

 

Thanks

  • 2 weeks later...
Posted

Hi Ben!

 

- What is alpha channel from depth buffer?

Alpha channel (transparency) is used with special pass - Deferred transparent (with no blending). Deferred transparent works that way:

  1. Filling G-buffer with opacity objects; (alpha 0)
  2. Lightning calculations for opacity objects (Deferred Light Pass); (alpha 0)
  3. Composing lightning + scene; (alpha 0)
  4. Adding new (deferred transparent) objects to G-Buffer; (alpha > 0)
  5. Lightning calculations (Deferred Light Pass);
  6. Composing lightning + scene (alpha blending with texture from step #3);

By adding new objects in step #4 to G-Buffer we can easily separate transparent and opacity objects in scene.

 

- If we don't use microfiber, what alpha value to put?

Just set it to 0.

 

- Does velocity refer to motion blur? If so, what values to use for no motion blur, black?

Yes, zero values for velocity will disable motion blur for object. But you should fill velocity buffer with correct values if you want keep Temporal Anti-Aliasing working.

 

- How is translucency used?

It is used to simulate light shine through the objects (leaves, for example).

 

- If we don't have decals, should the decal values be black?

Yes, indeed. But if you don't use any decals in your project - you can just disable them via render_decals 0 console command.

 

- Does occlusion refers to ambient occlusion? Doesn't Unigine compute this as post processing? When not using this, should I put white?

No, occlusion in G-Buffer = baked occlusion (so called surface AO). Ambient occlusion is working alongside with it. If you don't have baked occlusion for your objects, you can just set this value to 1.0.

 

Also, for filling the G-buffers you can use USSL methods (such as SET_DEPTH / SET_MICROFIBER and so on): https://developer.unigine.com/en/docs/2.1.1/code/wrapper/types#set_depth_value

 

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

  • 2 weeks later...
Posted

Thanks for all the info!  We should be fine now - No more major points of confusion.

×
×
  • Create New...