Commit Graph

15 Commits

Author SHA1 Message Date
Mathias Agopian
ea34691625 Support a maximum of 8 render buffers (from 4)
We chose 8 renderbuffer because it seems to be commonly supported
on mobile gpu and is more than 6 which is needed for generating
cubemaps. 4 was the minimum guaranteed by ES3.0.

The main changes here are:
- TargetBufferFlags is now a uint32_t instead of uint8_t
- The number of render buffer supported by filament and supported by
  the hardware can now be different. Applications/users now must
  query this value if more than 4 is needed.
- added a backend query (used gl terminology)


This is a redo of a previous attempt. There was an issue in the GL
backend that caused MRT to fail on some devices.
2021-05-04 10:53:07 -07:00
Mathias Agopian
8bd73a44c9 Revert "Support a maximum of 8 render buffers (from 4)" (#3868)
This reverts commit 6f948c101f.

This is breaking rendering on Android when certain postprocessing
effects are disabled (e.g. bloom/msaa/dof).
2021-04-27 22:56:10 -07:00
Mathias Agopian
6f948c101f Support a maximum of 8 render buffers (from 4)
We chose 8 renderbuffer because it seems to be commonly supported
on mobile gpu and is more than 6 which is needed for generating
cubemaps. 4 was the minimum guaranteed by ES3.0.

The main changes here are:
- TargetBufferFlags is now a uint32_t instead of uint8_t
- The number of render buffer supported by filament and supported by
  the hardware can now be different. Applications/users now must
  query this value if more than 4 is needed.
- added a backend query (used gl terminology)
2021-04-27 12:15:22 -07:00
Ben Doherty
b0c11c17e9 Add outputs block to material definition (#2823) 2020-07-20 16:48:00 -07:00
Mathias Agopian
d3f5164fcb New DoF implementation (#2700)
This implementation is an order of magnitude more efficient, running
in about 6ms on Pixel 4.

We're using the ring binning technique described in "Life of a Bokeh",
SIGGRAPH 2018.
2020-06-25 16:37:16 -07:00
Pixelflinger
2adfb259c6 fix shader overflows leading to black pixels
we clamp the output of post_process materials to 0,FLT16_MAX
2020-04-08 11:27:18 -07:00
Ben Doherty
82c7e4d988 Add new post-process functions (#1400) 2019-07-11 14:06:26 -07:00
Ben Doherty
b15abe9e5e Rename post-process generator functions (#1395) 2019-07-11 10:44:46 -07:00
Romain Guy
9d31b7c008 Formatting of shaders 2019-06-04 16:23:20 -07:00
Romain Guy
cabdc255f5 Shader code cleanup
roughness is now called perceptualRoughness and linearRoughness
is now called roughness. It better matches papers, etc.
2019-05-20 14:45:26 -07:00
Mathias Agopian
07bb62490b Add an option to turn dithering on/off 2019-03-12 13:32:28 -07:00
Pixelflinger
8a6de4cff1 Fix fxaa offset (#868)
vertex shader interpolants are interpolated at pixel centers by the GPU,
but we were doing our own "pixel-center" adjustment, so we ended-up with
"vertex_uv" at a pixel corner instead of center.

with this change, the vertex shader always compute vertex_uv in
fractional texels and the conversion to texture coordinates is done
in the fxaa code.

The half-pixel adjustment is removed.

This leads to sharper looking images because in addition to shifting
everything by 0.5 pixels, this was essentially applying a box-filter
to the whole picture -- kind of like taking 1 mip level down.
2019-02-25 13:22:14 -08:00
Romain Guy
4901f6f72a Fix FXAA computations in mediump (#643)
* Fix FXAA computations in mediump

UV coordinates computed in highp should be passed to the FXAA function
in highp as well. This change also fixes a potential division by 0 which
was causing dir1 to have components set to inifinity, thus breaking the
texture sampling calls below. We fix this with an early exit when a
potential division by 0 is detected. The original code contained a bias
to try to avoid this problem but that bias was not always enough. It
was frequent in mediump to cancel out the bias.

* Update shaders/src/fxaa.fs

Co-Authored-By: romainguy <romainguy@curious-creature.com>
2018-12-14 22:48:26 -08:00
Philip Rideout
9e7b589d0a Fix FXAA pixel alignment.
Fixes #397.
2018-10-19 16:42:01 -07:00
Romain Guy
b3d758f3b3 Initial commit 2018-08-03 10:38:22 -07:00