Closed balarayen closed 4 years ago
All you have to do is enable bloom (and you shouldn't set the camera stream as the dirt texture) on the Filament View object. Then you need either a strong light or a strong emissive material to get bloom.
@romainguy But setBloomOptions mandates to pass a dirt texture. Without a texture, it crashed due to null. What should be passed as the dirt texture? Please clarify.
In View.java
/**
* Sets bloom options.
*
* @param options Options for bloom.
*/
public void setBloomOptions(@NonNull BloomOptions options) {
mBloomOptions = options;
nSetBloomOptions(getNativeObject(), options.dirt.getNativeObject(),
options.dirtStrength, options.strength, options.resolution,
options.anamorphism, options.levels, options.blendingMode.ordinal(),
options.threshold, options.enabled);
}
The dirt texture is optional.
@romainguy But setBloomOptions mandates to pass a dirt texture. Without a texture, it crashed due to null. What should be passed as the dirt texture? Please clarify.
In View.java
/** * Sets bloom options. * * @param options Options for bloom. */ public void setBloomOptions(@NonNull BloomOptions options) { mBloomOptions = options; nSetBloomOptions(getNativeObject(), options.dirt.getNativeObject(), options.dirtStrength, options.strength, options.resolution, options.anamorphism, options.levels, options.blendingMode.ordinal(), options.threshold, options.enabled); }
This code from my previous comment is from filament 1.4.5. With the latest updates from sceneformsdk, I could upgrade filament to v1.7.0, where I can pass the dirt as null. Thanks @romainguy for your time.
public void setBloomOptions(@NonNull BloomOptions options) {
mBloomOptions = options;
nSetBloomOptions(getNativeObject(), options.dirt != null ? options.dirt.getNativeObject() : 0,
options.dirtStrength, options.strength, options.resolution,
options.anamorphism, options.levels, options.blendingMode.ordinal(),
options.threshold, options.enabled);
}
It's a bug in an old version, Sceneform was recently updated to Filament 1.7.0 so you should update your copy of Sceneform.
In Android sceneform sdk, I tried enabling bloom option by using the camerastream's ExternalTexture as the dirt texture. It makes everything that are whitish in the camera scene to glow.
But I want to make a specific face of a cube (say glb model) that has some emissive material in red color to glow. How to do that with a FilamentAsset? Please clarify.
Smartphone: