* MaterialInstance now has setMaskThreshold for convenience.
* Materials now support dynamic doubleSided property.
This does not change the format of material packages because they
already have both getDoubleSided() and getDoubleSidedSet().
The only way in which this change could impact existing applications is
that materials that explicity set doubleSided to "false" will now
respect the material's culling mode, rather than forcing it to NONE.
Fixes gltf_viewer with littlest_tokyo in ubershader mode.
Fixes#963.
* JNI for dynamic material properties.
* Add underscore prefix to internal material params.
* Remove un-needed mat info field.
We where treating a direction as a vector when projecting the camera's
forward vector. We never saw this bug before because we always used
<0,0,0> as the origin of the light space.
Now that we can pick an arbitrary light-space, we use the camera's
origin. Other choices are possible. But the camera origin is a nice
reference point.
Also simplify some code.
- "stable" mode disables all resolution optimizations that can affect
stability of the shadow map (e.g. lispsm, focusing)
- expose near/far hint + stable option to java
We were using the view frustum as a basis instead of the shadow
receivers volume which didn't give a good warping for the scene, we
were working around it by setting a virtual near plane dynamically.
Now that the warping frustum is tight, the virtual near plane is
no longer needed -- it's still needed for the user to adjust the
precision and the default is still 1m.
This is our first ImGui extension, it draws a draggable 3D arrow for
manipulating a unit vector. This is especially useful for tweaking the
light direction.
this is mostly simplifying and playing nicer with the framegraph, in
particular, now the framegraph computes the discard and clear flags
for the color pass.
the next step will be to move the shadow pass to the framegraph.
* Add postLightingColor property to materials
This property can be used to modify the color computed in the lighting
passes of the materials. That color is blended with the computed color
according to the postLightingBlending option (add, transparent or opaque).
* Remove test
* Update docs
* Address code review comment
* Switch postLightingColor default blend mode to transparent
One of the recent releases of emsdk moved its GL-related utility methods
into an object called GL, previously it exposed them directly.
This change also makes it so that we create the WebGL 2.0 context
and register it with emscripten, rather than the other way around.
Note that our CI does "emsdk activate latest", not sure when this broke
exactly.
* Removed STL headers from filameshio/MeshReader.h modified the samples to work the same, and made an effort to remedy the jsbindings although I'm not experienced with them.
* Fixed assignment operators for MaterialRegistry
* Fixed formating for MeshReader Material Registry
* Forgot one format
* Forgot another format
This is just a cleanup and does not change any behavior. The old code
was a little strange because we'd generate code designed for OpenGL but
we'd pass VULKAN to the code generator. This was a little white lie that
really meant: "I will need SPIRV (for optimization purposes only)"
This fixes two issues related to the Vulkan backend, one being a build
issue and the other being a run-time issue:
(1) Compile-Time Issue
To prevent accidental introduction of padding into hashed structures,
the Vulkan backend was static-asserting the size of the hash input. I
think it's fine to simply use a pragma pack instead.
(2) Run-Time Issue
SibGenerator was erroneuously using BindingPoints::COUNT instead of
UNIFORM_BINDING_COUNT for determining the first sampler binding index.
(Hopefully this logic will go away after some upcoming Vulkan cleanup.)
Since SibGenerator does not include Program, this moves the uniform and
sampler counts into EngineEnums, which might be a good place anyway
since they are ideally "config" constants.
There is a new static method that can be used by derived classes to
instantiate an OpenGLDriver.
This is to support existing clients that use their own implementation
of OpenGLPlatform with filament's OpenGLDriver implementation.
There are two changes involved here:
1) Recreate (do not recycle) the submission fences at every frame.
2) Add shared ownership semantics to existing fences to allow DriverAPI
clients to "own" fences.
The first change was motivated by FrameSkipper, which might have a
fence list that is longer than the number of swap chain contexts.
The second change was implemented simply by creating a tiny wrapper
struct for VkFence with a proper constructor and destructor, then
leveraging shared_ptr.
There are a couple reasons for this change. First of all, creating a
Vulkan fence outside of beginFrame / endFrame is not ideal because
the backend does not know yet which command buffer will be chosen
during swap chain acquisition.
Secondly, the Renderer currently calls endFrame in this order:
frameInfoManager.endFrame
mFrameSkipper.endFrame
driver.endFrame
However the beginFrame calls were ordered like this:
frameInfoManager.beginFrame
driver.beginFrame
mFrameSkipper.beginFrame
This change makes it such that the beginFrame calls have the reverse
ordering of the endFrame calls, which is less surprising.
I did a poor man's sanity check by running textured-object on a Pixel 2,
(which enables dynamic resolution) and hacking PostProcessManager to
make it visually obvious if anything were amiss.
This is mostly about moving constant from EngineEnums.h to
the backend, either in Program.h or DriverEnums.h
The goal is that libbackend doesn't depend on EngineEnums.h
OpenGLPlatform, VulkanPlatform and MetalPlatfrom are no longer public
classes, they never should have been.
This will break code using those, the solution is simply to copy the
header locally.