This example has fallen out of date, I tried to resurrect it but it
turned out to be non-trivial, given the special nature of emscripten's
generated JavaScript wrappers.
It might be better to provide an example that uses rollup, since that's
the bundler that model-viewer uses, or a simple TypeScript example.
For now, I think our simple HTML + raw JS samples are sufficient.
We can now save an arbitrary (but decided at compile time) number of
entries containing information about previous frames and it for while
drawing the current frame. Typically this is used for such effects as
TAA, screen-space reflection, building probes over time, etc...
Currently the frame history consists of one frame per View. FView
provides a new (internal) getFrameHistory() method used to access
previous frames entries as well as to save the current's frame
information.
The FrameGraphPassResources (which is available in the execute closure
of a FrameGraph pass) has a new detach() method which can be used to
remove that resource from the FrameGraph lifetime management, at which
point it becomes the responsibility of the caller. Typically this
resource will be stored in the frame history.
The FrameGraph cannot store pointers internally because all objects
are stored in vectors. Unfortunately we were storing the writer of
resources as a pointer.
This is fixed by storing an index instead.
Sets of post-process materials are in their own folder now.
Also moved fxaa.fs from shaders/ to materials/ so it's next to the
material that includes it. This file is not shared with any other
material.
This prevents strange behavior with semi-transparent render targets,
which the model viewer team discovered when testing against the Khronos
alpha test conformance model.
* attempt to reduce code size in PostProcessManager
The two main changes are:
- materials are now stored in a hash map which allows us to
automatically destroy all of them using one loop -- instead of
having to call terminate() for each of them.
- factored a very common sequence of code:
commit()
use()
beginRenderPass()
draw()
endRenderPass()
This makes the code easier to write and also results in less code.
There are also minor other changes, e.g. RenderPass constructor is not
inline anymore.
This fixes the depth fighting in the column of red spheres in the test
model while in filamat mode. Thanks Romain for catching this.
It also makes filamat mode more consistent with ubershader mode.
So...we use integers for bone indices, and that makes them special. :)
On May 26, the emsdk WebGL 2.0 wrapper for the integer variant of
VertexAttribPointer was broken due to an incomplete renaming operation
from an emscripten contributor.
I have a pending upstream fix to the emscripten repo (#11742) but for
now we can workaround this with a simple monkeypatch.
Fixes#2856.
We now validate supported combinations of internalFormat vs. format/type.
We currently follow the GLES specification, but we could be more
restrictive if needed for vulkan/metal.
The validation terminates in debug builds and logs (and becomes a no-op)
in release builds.
- we were not clamping the color grading output to [0,1]
- we were not using a supported input (cpu) pixel format for the
3d LUT in low and medium quality
fast tiles (i.e. where all pixels have the same circle-of-confusion)
are allowed to use bilinear filtering.
this results in better looking DoF in these areas.
Using a ring density of 4 was wrong -- apparently I can't add.
With a density of 8 we can guarantee we don't have gaps between samples
when using mips properly (or at least gaps are consistant and
predictable).
* Add quality option to ColorGrading
Low: 16x16x16 LUT in 10 bit
Medium: 32x32x32 LUT in 10 bit
High: 32x32x32 LUT in 16 bit
Ultra: 64x64x64 LUT in 16 bit
* Move comment