* Fix filament-utils-android build on Windows
* Update build.gradle
* nit: use char version instead
* Fix No signature of method: java.lang.String.replace() is applicable for argument types: (Character, String) values: [\, /]
deprecated Texture(long nativeTexture) in favor of
Texture(Engine, long nativeTexture), there is no difference
currently, but in the future Texture(Engine, long nativeTexture)
will be able to validate the native pointer.
The JNI layer already does this, but can only track objects it created,
sometimes developers might create filament objects on the native side
and wrap them into java objects and this might cause a failure to
detected when objects are double-destroyed.
However, this can often be caught by the native code -- so, when the
native side is asked to destroy an object that doesn't exist, we now
return an error (exception if enabled) and we throw an exception
on the java side.
Filament typically doesn't do this kind of tests, however these bugs
can be very hard to find, and the cost is small.
- all backend return nullptr when handle_cast<> is called with
an invalid handle. this ensures a prompt crash on all backends rather
than different behaviors, some including potential memory corruptions.
assert() in debug builds. The proper way to check is to cast the
handle to bool.
- be more consistent in the GL backend about where we check for the
validity of handle -- which is basically nowhere, except for destroy
(because we have the same semantic than free(nullptr) -- i.e. no-op.
Other places are treated like bad pointers, and as per above
handle_cast<> will return nullptr.
- make sure we don't call FScene::updateUBOs with an invalid handle
when the scene is empty
To see proof that this works, use gltf_viewer with -u and examine the
node hierarchy. You will now see the correct material names instead of
the ubershader names.
When no name is provided during instance creation, it does NOT inherit
the name of its parent material. This is because instances should be
lightweight and users can already do instance->getMaterial()->getName().
In a subsequent PR, this feature will be exercised and tested via the
gltfio AssetLoader.
Fixes#2485.
- we were allocating objects with a destructor in the command stream
which is always invalid because there is no guarantee that when
the callback is called, the underlaying memory is still valid
(and it wasn't).
- AutoBuffer move-ctor wasn't moving some of its state, which would
lead to destroying the same ref several times.
This updates the tutorial markdown, fixes up the literate programming
Python script, and updates the web site itself.
The doc build script now uses a Pipfile instead of "requirements.txt",
which I find less frustrating since it does not interfere with other
Python projects on your machine.
Fixes#2483.
- bokeh rotates with the aperture diameter
- match sample count on cpu and cpu sides which affects CoC calculation
- feather blur radius to avoid visible "steps" in bokeh size
This fixes a crash with `lightbulb -m`.
- During VkImage creation, the subresource depth should be 1 since it is
meant for 3D textures.
- Render targets should select a single level from an array texture, not
all of them.
- Add debug_trap to validation errors to make them easier to debug.
This fixes dynamic lighting and SSAO when a viewport is not in 0,0.
In practice this currently happens only when all post-processing is
disabled.
Instead of using gl_FragCoord we introduce a new API,
getNormalizedViewportCoord(), which as the name implies returns
normalized [0, 1] viewport coordinates with origin at the bottom-left,
on all platforms.
This is implemented in this PR by interpolating gl_Position.
We keep very the same (or very close) quality by exploiting h/w
filtering. On the flip side, this is not compatible with dithering,
which is removed here.
In OpenGL with use glInvalidateFramebuffer() for hinting controlling
the load/store of tiles. However, glInvalidateFramebuffer() conceptually
destroys the content of the framebuffer attachment.
This causes a problem when we want for instance to use a buffer for
reading only (e.g. a depth buffer) in multiple passes. In such
scenario, the attachment will be marked as "discard" (which is a
misnomer for storeOp==DONT_CARE in vulkan parlance), without the
intention of making the buffer invalid.
We fix this by ignoring the discardEnd flags entirely if a buffer
has not been written. In this case, we relying on the driver to not
write the tiles out -- but we don't have any other way to express
this in GL.
This issue cannot be encountered currently because the framegraph
is not aggressive enough setting the discardEnd flags.
As per the spec:
```
vkCmdWriteTimestamp latches the value of the timer when all previous
commands have completed executing as far as the specified pipeline
stage, and writes the timestamp value to memory.
```