update java and js bindings (#9676)
* implement some missing javascript bindings DOCS_FORCE * use exclusively javadoc comments in Options.h This is because this file is currently used to generate java and javascript bindings and doxygen can ingest javadoc. And regenerate javascript and java bindings * add missing java bindings
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <filament/Camera.h>
|
||||
|
||||
|
||||
#include <utils/Entity.h>
|
||||
|
||||
#include <math/mat4.h>
|
||||
@@ -40,6 +41,13 @@ Java_com_google_android_filament_Camera_nSetProjectionFov(JNIEnv*, jclass ,
|
||||
camera->setProjection(fovInDegrees, aspect, near, far, (Camera::Fov) fov);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT jdouble JNICALL
|
||||
Java_com_google_android_filament_Camera_nGetFieldOfViewInDegrees(JNIEnv*, jclass,
|
||||
jlong nativeCamera, jint direction) {
|
||||
Camera *camera = (Camera *) nativeCamera;
|
||||
return camera->getFieldOfViewInDegrees((Camera::Fov) direction);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_Camera_nSetLensProjection(JNIEnv*, jclass,
|
||||
jlong nativeCamera, jdouble focalLength, jdouble aspect, jdouble near, jdouble far) {
|
||||
@@ -62,6 +70,21 @@ Java_com_google_android_filament_Camera_nSetCustomProjection(JNIEnv *env, jclass
|
||||
env->ReleaseDoubleArrayElements(inProjectionForCulling_, inProjectionForCulling, JNI_ABORT);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_Camera_nSetCustomEyeProjection(JNIEnv *env, jclass,
|
||||
jlong nativeCamera, jdoubleArray inProjection_, jint count, jdoubleArray inProjectionForCulling_,
|
||||
jdouble near, jdouble far) {
|
||||
Camera *camera = (Camera *) nativeCamera;
|
||||
jdouble *inProjection = env->GetDoubleArrayElements(inProjection_, NULL);
|
||||
jdouble *inProjectionForCulling = env->GetDoubleArrayElements(inProjectionForCulling_, NULL);
|
||||
camera->setCustomEyeProjection(
|
||||
reinterpret_cast<const filament::math::mat4 *>(inProjection), (size_t) count,
|
||||
*reinterpret_cast<const filament::math::mat4 *>(inProjectionForCulling),
|
||||
near, far);
|
||||
env->ReleaseDoubleArrayElements(inProjection_, inProjection, JNI_ABORT);
|
||||
env->ReleaseDoubleArrayElements(inProjectionForCulling_, inProjectionForCulling, JNI_ABORT);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_Camera_nSetScaling(JNIEnv* env, jclass,
|
||||
jlong nativeCamera, jdouble x, jdouble y) {
|
||||
@@ -76,6 +99,17 @@ Java_com_google_android_filament_Camera_nSetShift(JNIEnv* env, jclass,
|
||||
camera->setShift({(double)x, (double)y});
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_Camera_nGetShift(JNIEnv* env, jclass,
|
||||
jlong nativeCamera, jdoubleArray out_) {
|
||||
Camera *camera = (Camera *) nativeCamera;
|
||||
jdouble *out = env->GetDoubleArrayElements(out_, NULL);
|
||||
filament::math::double2 s = camera->getShift();
|
||||
out[0] = s.x;
|
||||
out[1] = s.y;
|
||||
env->ReleaseDoubleArrayElements(out_, out, 0);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_Camera_nLookAt(JNIEnv*, jclass, jlong nativeCamera,
|
||||
jdouble eye_x, jdouble eye_y, jdouble eye_z, jdouble center_x, jdouble center_y,
|
||||
@@ -115,6 +149,15 @@ Java_com_google_android_filament_Camera_nSetModelMatrixFp64(JNIEnv *env, jclass,
|
||||
env->ReleaseDoubleArrayElements(in_, in, JNI_ABORT);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_Camera_nSetEyeModelMatrix(JNIEnv *env, jclass,
|
||||
jlong nativeCamera, jint eyeId, jdoubleArray model_) {
|
||||
Camera* camera = (Camera *) nativeCamera;
|
||||
jdouble *model = env->GetDoubleArrayElements(model_, NULL);
|
||||
camera->setEyeModelMatrix((uint8_t)eyeId, *reinterpret_cast<const filament::math::mat4*>(model));
|
||||
env->ReleaseDoubleArrayElements(model_, model, JNI_ABORT);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_Camera_nGetProjectionMatrix(JNIEnv *env, jclass,
|
||||
jlong nativeCamera, jdoubleArray out_) {
|
||||
@@ -280,3 +323,5 @@ Java_com_google_android_filament_Camera_nComputeEffectiveFov(JNIEnv*, jclass,
|
||||
jdouble fovInDegrees, jdouble focusDistance) {
|
||||
return Camera::computeEffectiveFov(fovInDegrees, focusDistance);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -96,6 +96,14 @@ Java_com_google_android_filament_Material_nGetBlendingMode(JNIEnv*, jclass,
|
||||
return (jint) material->getBlendingMode();
|
||||
}
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_google_android_filament_Material_nGetTransparencyMode(JNIEnv*, jclass,
|
||||
jlong nativeMaterial) {
|
||||
Material* material = (Material*) nativeMaterial;
|
||||
return (jint) material->getTransparencyMode();
|
||||
}
|
||||
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT jint JNICALL
|
||||
|
||||
@@ -564,3 +564,19 @@ Java_com_google_android_filament_MaterialInstance_nGetDepthFunc(JNIEnv* env, jcl
|
||||
MaterialInstance* instance = (MaterialInstance*)nativeMaterialInstance;
|
||||
return (jint)instance->getDepthFunc();
|
||||
}
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_MaterialInstance_nSetTransparencyMode(JNIEnv*, jclass,
|
||||
jlong nativeMaterialInstance, jint mode) {
|
||||
MaterialInstance* instance = (MaterialInstance*) nativeMaterialInstance;
|
||||
instance->setTransparencyMode((MaterialInstance::TransparencyMode) mode);
|
||||
}
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_google_android_filament_MaterialInstance_nGetTransparencyMode(JNIEnv*, jclass,
|
||||
jlong nativeMaterialInstance) {
|
||||
MaterialInstance* instance = (MaterialInstance*) nativeMaterialInstance;
|
||||
return (jint) instance->getTransparencyMode();
|
||||
}
|
||||
|
||||
@@ -173,6 +173,13 @@ Java_com_google_android_filament_Texture_nBuilderSwizzle(JNIEnv *, jclass ,
|
||||
(Texture::Swizzle)r, (Texture::Swizzle)g, (Texture::Swizzle)b, (Texture::Swizzle)a);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_Texture_nBuilderSamples(JNIEnv*, jclass,
|
||||
jlong nativeBuilder, jint samples) {
|
||||
Texture::Builder *builder = (Texture::Builder *) nativeBuilder;
|
||||
builder->samples((uint8_t) samples);
|
||||
}
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_Texture_nBuilderImportTexture(JNIEnv*, jclass, jlong nativeBuilder, jlong id) {
|
||||
|
||||
@@ -76,6 +76,12 @@ Java_com_google_android_filament_View_nSetVisibleLayers(JNIEnv*, jclass, jlong n
|
||||
view->setVisibleLayers((uint8_t) select, (uint8_t) value);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT jint JNICALL
|
||||
Java_com_google_android_filament_View_nGetVisibleLayers(JNIEnv*, jclass, jlong nativeView) {
|
||||
View* view = (View*) nativeView;
|
||||
return view->getVisibleLayers();
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_View_nSetShadowingEnabled(JNIEnv*, jclass, jlong nativeView, jboolean enabled) {
|
||||
View* view = (View*) nativeView;
|
||||
@@ -440,6 +446,18 @@ Java_com_google_android_filament_View_nIsShadowingEnabled(JNIEnv *, jclass, jlon
|
||||
return (jboolean)view->isShadowingEnabled();
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_View_nSetFrustumCullingEnabled(JNIEnv*, jclass, jlong nativeView, jboolean enabled) {
|
||||
View* view = (View*) nativeView;
|
||||
view->setFrustumCullingEnabled(enabled);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT jboolean JNICALL
|
||||
Java_com_google_android_filament_View_nIsFrustumCullingEnabled(JNIEnv*, jclass, jlong nativeView) {
|
||||
View* view = (View*) nativeView;
|
||||
return (jboolean)view->isFrustumCullingEnabled();
|
||||
}
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_View_nSetScreenSpaceRefractionEnabled(JNIEnv *, jclass,
|
||||
|
||||
@@ -136,4 +136,13 @@ final class Asserts {
|
||||
throw new ArrayIndexOutOfBoundsException("Array length must be at least 4");
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull @Size(min = 2)
|
||||
static double[] assertDouble2(@Nullable double[] out) {
|
||||
if (out == null) out = new double[2];
|
||||
else if (out.length < 2) {
|
||||
throw new ArrayIndexOutOfBoundsException("Array length must be at least 2");
|
||||
}
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,6 +343,27 @@ public class Camera {
|
||||
nSetScaling(getNativeObject(), xscaling, yscaling);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a custom projection matrix for each eye.
|
||||
*
|
||||
* @param inProjection An array of projection matrices, one for each eye.
|
||||
* Must have at least 16 * count elements.
|
||||
* @param count Number of eyes to set.
|
||||
* @param inProjectionForCulling Custom projection matrix for culling, must encompass all eyes.
|
||||
* @param near Distance to the near plane.
|
||||
* @param far Distance to the far plane.
|
||||
*/
|
||||
public void setCustomEyeProjection(
|
||||
@NonNull double[] inProjection, int count,
|
||||
@NonNull @Size(min = 16) double[] inProjectionForCulling,
|
||||
double near, double far) {
|
||||
Asserts.assertMat4dIn(inProjectionForCulling);
|
||||
if (inProjection.length < 16 * count) {
|
||||
throw new IllegalArgumentException("inProjection array too small for the given count");
|
||||
}
|
||||
nSetCustomEyeProjection(getNativeObject(), inProjection, count, inProjectionForCulling, near, far);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets an additional matrix that scales the projection matrix.
|
||||
*
|
||||
@@ -399,6 +420,31 @@ public class Camera {
|
||||
nSetShift(getNativeObject(), xshift, yshift);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the shift amount used to translate the projection matrix.
|
||||
*
|
||||
* @param out A 2-double array where the shift will be stored, or null.
|
||||
* @return A 2-double array containing the x and y shift.
|
||||
*/
|
||||
@NonNull @Size(min = 2)
|
||||
public double[] getShift(@Nullable @Size(min = 2) double[] out) {
|
||||
out = Asserts.assertDouble2(out);
|
||||
nGetShift(getNativeObject(), out);
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the camera's field of view in degrees.
|
||||
*
|
||||
* @param direction The direction of the FOV (VERTICAL or HORIZONTAL).
|
||||
* @return The field of view in degrees.
|
||||
*/
|
||||
public double getFieldOfViewInDegrees(@NonNull Fov direction) {
|
||||
return nGetFieldOfViewInDegrees(getNativeObject(), direction.ordinal());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Sets the camera's model matrix.
|
||||
* <p>
|
||||
@@ -745,6 +791,17 @@ public class Camera {
|
||||
return mEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the model matrix for a specific eye.
|
||||
*
|
||||
* @param eyeId The index of the eye.
|
||||
* @param model The model matrix for the eye.
|
||||
*/
|
||||
public void setEyeModelMatrix(int eyeId, @NonNull @Size(min = 16) double[] model) {
|
||||
Asserts.assertMat4dIn(model);
|
||||
nSetEyeModelMatrix(getNativeObject(), eyeId, model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to compute the effective focal length taking into account the focus distance
|
||||
*
|
||||
@@ -784,8 +841,13 @@ public class Camera {
|
||||
private static native void nSetCustomProjection(long nativeCamera, double[] inProjection, double[] inProjectionForCulling, double near, double far);
|
||||
private static native void nSetScaling(long nativeCamera, double x, double y);
|
||||
private static native void nSetShift(long nativeCamera, double x, double y);
|
||||
private static native void nGetShift(long nativeCamera, double[] out);
|
||||
private static native void nSetModelMatrix(long nativeCamera, float[] in);
|
||||
private static native void nSetModelMatrixFp64(long nativeCamera, double[] in);
|
||||
private static native void nSetEyeModelMatrix(long nativeCamera, int eyeId, double[] model);
|
||||
private static native void nSetCustomEyeProjection(long nativeCamera, double[] inProjection, int count, double[] inProjectionForCulling, double near, double far);
|
||||
private static native double nGetFieldOfViewInDegrees(long nativeCamera, int direction);
|
||||
|
||||
private static native void nLookAt(long nativeCamera, double eyeX, double eyeY, double eyeZ, double centerX, double centerY, double centerZ, double upX, double upY, double upZ);
|
||||
private static native double nGetNear(long nativeCamera);
|
||||
private static native double nGetCullingFar(long nativeCamera);
|
||||
|
||||
@@ -54,6 +54,7 @@ public class Material {
|
||||
static final CullingMode[] sCullingModeValues = CullingMode.values();
|
||||
static final VertexBuffer.VertexAttribute[] sVertexAttributeValues =
|
||||
VertexBuffer.VertexAttribute.values();
|
||||
static final TransparencyMode[] sTransparencyModeValues = TransparencyMode.values();
|
||||
}
|
||||
|
||||
private long mNativeObject;
|
||||
@@ -160,6 +161,31 @@ public class Material {
|
||||
SCREEN,
|
||||
}
|
||||
|
||||
/**
|
||||
* How transparent objects are handled
|
||||
*
|
||||
* @see
|
||||
* <a href="https://google.github.io/filament/Materials.html#materialdefinitions/materialblock/blendingandtransparency:transparencymode">
|
||||
* Blending and transparency: transparencyMode</a>
|
||||
*/
|
||||
public enum TransparencyMode {
|
||||
/** The transparent object is drawn honoring the raster state. */
|
||||
DEFAULT,
|
||||
|
||||
/**
|
||||
* The transparent object is first drawn in the depth buffer,
|
||||
* then in the color buffer, honoring the culling mode, but ignoring the depth test function.
|
||||
*/
|
||||
TWO_PASSES_ONE_SIDE,
|
||||
|
||||
/**
|
||||
* The transparent object is drawn twice in the color buffer,
|
||||
* first with back faces only, then with front faces; the culling
|
||||
* mode is ignored. Can be combined with two-sided lighting.
|
||||
*/
|
||||
TWO_PASSES_TWO_SIDES
|
||||
}
|
||||
|
||||
/**
|
||||
* Supported refraction modes
|
||||
*
|
||||
@@ -587,6 +613,18 @@ public class Material {
|
||||
return EnumCache.sBlendingModeValues[nGetBlendingMode(getNativeObject())];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the transparency mode of this material.
|
||||
* This value only makes sense when the blending mode is transparent or fade.
|
||||
*
|
||||
* @see
|
||||
* <a href="https://google.github.io/filament/Materials.html#materialdefinitions/materialblock/blendingandtransparency:transparencymode">
|
||||
* Blending and transparency: transparencyMode</a>
|
||||
*/
|
||||
public TransparencyMode getTransparencyMode() {
|
||||
return EnumCache.sTransparencyModeValues[nGetTransparencyMode(getNativeObject())];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the refraction mode of this material.
|
||||
*
|
||||
@@ -1130,6 +1168,7 @@ public class Material {
|
||||
private static native int nGetShading(long nativeMaterial);
|
||||
private static native int nGetInterpolation(long nativeMaterial);
|
||||
private static native int nGetBlendingMode(long nativeMaterial);
|
||||
private static native int nGetTransparencyMode(long nativeMaterial);
|
||||
private static native int nGetVertexDomain(long nativeMaterial);
|
||||
private static native int nGetCullingMode(long nativeMaterial);
|
||||
private static native boolean nIsColorWriteEnabled(long nativeMaterial);
|
||||
|
||||
@@ -537,6 +537,14 @@ public class MaterialInstance {
|
||||
nSetDoubleSided(getNativeObject(), doubleSided);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the transparency mode for this material instance.
|
||||
* @see Material.TransparencyMode
|
||||
*/
|
||||
public void setTransparencyMode(@NonNull Material.TransparencyMode mode) {
|
||||
nSetTransparencyMode(getNativeObject(), mode.ordinal());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether double-sided lighting is enabled when the parent Material has double-sided
|
||||
* capability.
|
||||
@@ -545,6 +553,14 @@ public class MaterialInstance {
|
||||
return nIsDoubleSided(getNativeObject());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the transparency mode.
|
||||
*/
|
||||
@NonNull
|
||||
public Material.TransparencyMode getTransparencyMode() {
|
||||
return Material.EnumCache.sTransparencyModeValues[nGetTransparencyMode(getNativeObject())];
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides the default triangle culling state that was set on the material.
|
||||
*
|
||||
@@ -982,4 +998,6 @@ public class MaterialInstance {
|
||||
private static native boolean nIsStencilWriteEnabled(long nativeMaterialInstance);
|
||||
private static native boolean nIsDepthCullingEnabled(long nativeMaterialInstance);
|
||||
private static native int nGetDepthFunc(long nativeMaterialInstance);
|
||||
private static native void nSetTransparencyMode(long nativeMaterialInstance, int mode);
|
||||
private static native int nGetTransparencyMode(long nativeMaterialInstance);
|
||||
}
|
||||
|
||||
@@ -795,6 +795,17 @@ public class Texture {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the number of samples for multisample anti-aliasing.
|
||||
* @param samples number of samples, must be at least 1. Default is 1.
|
||||
* @return This Builder, for chaining calls.
|
||||
*/
|
||||
@NonNull
|
||||
public Builder samples(@IntRange(from = 1) int samples) {
|
||||
nBuilderSamples(mNativeBuilder, samples);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the texture's internal format.
|
||||
* <p>The internal format specifies how texels are stored (which may be different from how
|
||||
@@ -1370,6 +1381,7 @@ public class Texture {
|
||||
private static native void nBuilderFormat(long nativeBuilder, int format);
|
||||
private static native void nBuilderUsage(long nativeBuilder, int flags);
|
||||
private static native void nBuilderSwizzle(long nativeBuilder, int r, int g, int b, int a);
|
||||
private static native void nBuilderSamples(long nativeBuilder, int samples);
|
||||
private static native void nBuilderImportTexture(long nativeBuilder, long id);
|
||||
private static native void nBuilderExternal(long nativeBuilder);
|
||||
private static native long nBuilderBuild(long nativeBuilder, long nativeEngine);
|
||||
|
||||
@@ -350,6 +350,26 @@ public class View {
|
||||
nSetVisibleLayers(getNativeObject(), select & 0xFF, values & 0xFF);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the visible layers.
|
||||
*
|
||||
* @return a bitmask specifying which layer is visible.
|
||||
*/
|
||||
public int getVisibleLayers() {
|
||||
return nGetVisibleLayers(getNativeObject());
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables a specific layer.
|
||||
*
|
||||
* @param layer Index of the layer to enable or disable, must be between 0 and 7.
|
||||
* @param enabled True to enable the layer, false to disable it.
|
||||
*/
|
||||
public void setLayerEnabled(@IntRange(from = 0, to = 7) int layer, boolean enabled) {
|
||||
int mask = 1 << layer;
|
||||
setVisibleLayers(mask, enabled ? mask : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables shadow mapping. Enabled by default.
|
||||
*
|
||||
@@ -368,6 +388,22 @@ public class View {
|
||||
return nIsShadowingEnabled(getNativeObject());
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables frustum culling. Enabled by default.
|
||||
*
|
||||
* @param enabled true enables frustum culling, false disables it.
|
||||
*/
|
||||
public void setFrustumCullingEnabled(boolean enabled) {
|
||||
nSetFrustumCullingEnabled(getNativeObject(), enabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return whether frustum culling is enabled
|
||||
*/
|
||||
public boolean isFrustumCullingEnabled() {
|
||||
return nIsFrustumCullingEnabled(getNativeObject());
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables screen space refraction. Enabled by default.
|
||||
*
|
||||
@@ -1322,6 +1358,9 @@ public class View {
|
||||
private static native boolean nHasCamera(long nativeView);
|
||||
private static native void nSetViewport(long nativeView, int left, int bottom, int width, int height);
|
||||
private static native void nSetVisibleLayers(long nativeView, int select, int value);
|
||||
private static native int nGetVisibleLayers(long nativeView);
|
||||
private static native void nSetFrustumCullingEnabled(long nativeView, boolean enabled);
|
||||
private static native boolean nIsFrustumCullingEnabled(long nativeView);
|
||||
private static native void nSetShadowingEnabled(long nativeView, boolean enabled);
|
||||
private static native void nSetRenderTarget(long nativeView, long nativeRenderTarget);
|
||||
private static native void nSetSampleCount(long nativeView, int count);
|
||||
@@ -1406,65 +1445,59 @@ public class View {
|
||||
* by lowering the resolution of a View, or to increase the quality when the
|
||||
* rendering is faster than the target frame rate.
|
||||
*
|
||||
* This structure can be used to specify the minimum scale factor used when
|
||||
* <p>This structure can be used to specify the minimum scale factor used when
|
||||
* lowering the resolution of a View, and the maximum scale factor used when
|
||||
* increasing the resolution for higher quality rendering. The scale factors
|
||||
* can be controlled on each X and Y axis independently. By default, all scale
|
||||
* factors are set to 1.0.
|
||||
* factors are set to 1.0.</p>
|
||||
*
|
||||
* enabled: enable or disables dynamic resolution on a View
|
||||
* <ul>
|
||||
* <li>enabled: enable or disables dynamic resolution on a View</li>
|
||||
*
|
||||
* homogeneousScaling: by default the system scales the major axis first. Set this to true
|
||||
* to force homogeneous scaling.
|
||||
* <li>homogeneousScaling: by default the system scales the major axis first. Set this to true
|
||||
* to force homogeneous scaling.</li>
|
||||
*
|
||||
* minScale: the minimum scale in X and Y this View should use
|
||||
* <li>minScale: the minimum scale in X and Y this View should use</li>
|
||||
*
|
||||
* maxScale: the maximum scale in X and Y this View should use
|
||||
* <li>maxScale: the maximum scale in X and Y this View should use</li>
|
||||
*
|
||||
* quality: upscaling quality.
|
||||
* LOW: 1 bilinear tap, Medium: 4 bilinear taps, High: 9 bilinear taps (tent)
|
||||
* <li>quality: upscaling quality.
|
||||
* LOW: 1 bilinear tap, Medium: 4 bilinear taps, High: 9 bilinear taps (tent)</li>
|
||||
* </ul>
|
||||
*
|
||||
* \note
|
||||
* <p>Note:
|
||||
* Dynamic resolution is only supported on platforms where the time to render
|
||||
* a frame can be measured accurately. On platforms where this is not supported,
|
||||
* Dynamic Resolution can't be enabled unless minScale == maxScale.
|
||||
* Dynamic Resolution can't be enabled unless <code>minScale == maxScale</code>.</p>
|
||||
*
|
||||
* @see Renderer::FrameRateOptions
|
||||
* @see Renderer.FrameRateOptions
|
||||
*
|
||||
*/
|
||||
public static class DynamicResolutionOptions {
|
||||
/**
|
||||
* minimum scale factors in x and y
|
||||
*/
|
||||
/** minimum scale factors in x and y */
|
||||
public float minScale = 0.5f;
|
||||
/**
|
||||
* maximum scale factors in x and y
|
||||
*/
|
||||
/** maximum scale factors in x and y */
|
||||
public float maxScale = 1.0f;
|
||||
/**
|
||||
* sharpness when QualityLevel::MEDIUM or higher is used [0 (disabled), 1 (sharpest)]
|
||||
*/
|
||||
/** sharpness when QualityLevel::MEDIUM or higher is used [0 (disabled), 1 (sharpest)] */
|
||||
public float sharpness = 0.9f;
|
||||
/**
|
||||
* enable or disable dynamic resolution
|
||||
*/
|
||||
/** enable or disable dynamic resolution */
|
||||
public boolean enabled = false;
|
||||
/**
|
||||
* set to true to force homogeneous scaling
|
||||
*/
|
||||
/** set to true to force homogeneous scaling */
|
||||
public boolean homogeneousScaling = false;
|
||||
/**
|
||||
* Upscaling quality
|
||||
* LOW: bilinear filtered blit. Fastest, poor quality
|
||||
* MEDIUM: Qualcomm Snapdragon Game Super Resolution (SGSR) 1.0
|
||||
* HIGH: AMD FidelityFX FSR1 w/ mobile optimizations
|
||||
* ULTRA: AMD FidelityFX FSR1
|
||||
* <ul>
|
||||
* <li>LOW: bilinear filtered blit. Fastest, poor quality</li>
|
||||
* <li>MEDIUM: Qualcomm Snapdragon Game Super Resolution (SGSR) 1.0</li>
|
||||
* <li>HIGH: AMD FidelityFX FSR1 w/ mobile optimizations</li>
|
||||
* <li>ULTRA: AMD FidelityFX FSR1</li>
|
||||
* </ul>
|
||||
* FSR1 and SGSR require a well anti-aliased (MSAA or TAA), noise free scene.
|
||||
* Avoid FXAA and dithering.
|
||||
*
|
||||
* The default upscaling quality is set to LOW.
|
||||
* <p>The default upscaling quality is set to LOW.</p>
|
||||
*
|
||||
* caveat: currently, 'quality' is always set to LOW if the View is TRANSLUCENT.
|
||||
* <p>caveat: currently, <code>quality</code> is always set to LOW if the View is TRANSLUCENT.</p>
|
||||
*/
|
||||
@NonNull
|
||||
public QualityLevel quality = QualityLevel.LOW;
|
||||
@@ -1473,134 +1506,98 @@ public class View {
|
||||
/**
|
||||
* Options to control the bloom effect
|
||||
*
|
||||
* enabled: Enable or disable the bloom post-processing effect. Disabled by default.
|
||||
* <ul>
|
||||
* <li>enabled: Enable or disable the bloom post-processing effect. Disabled by default.</li>
|
||||
*
|
||||
* levels: Number of successive blurs to achieve the blur effect, the minimum is 3 and the
|
||||
* <li>levels: Number of successive blurs to achieve the blur effect, the minimum is 3 and the
|
||||
* maximum is 12. This value together with resolution influences the spread of the
|
||||
* blur effect. This value can be silently reduced to accommodate the original
|
||||
* image size.
|
||||
* image size.</li>
|
||||
*
|
||||
* resolution: Resolution of bloom's minor axis. The minimum value is 2^levels and the
|
||||
* <li>resolution: Resolution of bloom's minor axis. The minimum value is 2^levels and the
|
||||
* the maximum is lower of the original resolution and 4096. This parameter is
|
||||
* silently clamped to the minimum and maximum.
|
||||
* It is highly recommended that this value be smaller than the target resolution
|
||||
* after dynamic resolution is applied (horizontally and vertically).
|
||||
* after dynamic resolution is applied (horizontally and vertically).</li>
|
||||
*
|
||||
* strength: how much of the bloom is added to the original image. Between 0 and 1.
|
||||
* <li>strength: how much of the bloom is added to the original image. Between 0 and 1.</li>
|
||||
*
|
||||
* blendMode: Whether the bloom effect is purely additive (false) or mixed with the original
|
||||
* image (true).
|
||||
* <li>blendMode: Whether the bloom effect is purely additive (false) or mixed with the original
|
||||
* image (true).</li>
|
||||
*
|
||||
* threshold: When enabled, a threshold at 1.0 is applied on the source image, this is
|
||||
* useful for artistic reasons and is usually needed when a dirt texture is used.
|
||||
* <li>threshold: When enabled, a threshold at 1.0 is applied on the source image, this is
|
||||
* useful for artistic reasons and is usually needed when a dirt texture is used.</li>
|
||||
*
|
||||
* dirt: A dirt/scratch/smudges texture (that can be RGB), which gets added to the
|
||||
* <li>dirt: A dirt/scratch/smudges texture (that can be RGB), which gets added to the
|
||||
* bloom effect. Smudges are visible where bloom occurs. Threshold must be
|
||||
* enabled for the dirt effect to work properly.
|
||||
* enabled for the dirt effect to work properly.</li>
|
||||
*
|
||||
* dirtStrength: Strength of the dirt texture.
|
||||
* <li>dirtStrength: Strength of the dirt texture.</li>
|
||||
* </ul>
|
||||
*/
|
||||
public static class BloomOptions {
|
||||
public enum BlendMode {
|
||||
/**
|
||||
* Bloom is modulated by the strength parameter and added to the scene
|
||||
*/
|
||||
/** Bloom is modulated by the strength parameter and added to the scene */
|
||||
ADD,
|
||||
/**
|
||||
* Bloom is interpolated with the scene using the strength parameter
|
||||
*/
|
||||
/** Bloom is interpolated with the scene using the strength parameter */
|
||||
INTERPOLATE,
|
||||
}
|
||||
|
||||
/**
|
||||
* user provided dirt texture
|
||||
*/
|
||||
/** user provided dirt texture */
|
||||
@Nullable
|
||||
public Texture dirt = null;
|
||||
/**
|
||||
* strength of the dirt texture
|
||||
*/
|
||||
/** strength of the dirt texture */
|
||||
public float dirtStrength = 0.2f;
|
||||
/**
|
||||
* bloom's strength between 0.0 and 1.0
|
||||
*/
|
||||
/** bloom's strength between 0.0 and 1.0 */
|
||||
public float strength = 0.10f;
|
||||
/**
|
||||
* resolution of vertical axis (2^levels to 2048)
|
||||
*/
|
||||
/** resolution of vertical axis (2^levels to 2048) */
|
||||
public int resolution = 384;
|
||||
/**
|
||||
* number of blur levels (1 to 11)
|
||||
*/
|
||||
/** number of blur levels (1 to 11) */
|
||||
public int levels = 6;
|
||||
/**
|
||||
* how the bloom effect is applied
|
||||
*/
|
||||
/** how the bloom effect is applied */
|
||||
@NonNull
|
||||
public BloomOptions.BlendMode blendMode = BloomOptions.BlendMode.ADD;
|
||||
/**
|
||||
* whether to threshold the source
|
||||
*/
|
||||
/** whether to threshold the source */
|
||||
public boolean threshold = true;
|
||||
/**
|
||||
* enable or disable bloom
|
||||
*/
|
||||
/** enable or disable bloom */
|
||||
public boolean enabled = false;
|
||||
/**
|
||||
* limit highlights to this value before bloom [10, +inf]
|
||||
*/
|
||||
/** limit highlights to this value before bloom [10, +inf] */
|
||||
public float highlight = 1000.0f;
|
||||
/**
|
||||
* Bloom quality level.
|
||||
* LOW (default): use a more optimized down-sampling filter, however there can be artifacts
|
||||
* with dynamic resolution, this can be alleviated by using the homogenous mode.
|
||||
* MEDIUM: Good balance between quality and performance.
|
||||
* HIGH: In this mode the bloom resolution is automatically increased to avoid artifacts.
|
||||
* <ul>
|
||||
* <li>LOW (default): use a more optimized down-sampling filter, however there can be artifacts
|
||||
* with dynamic resolution, this can be alleviated by using the homogenous mode.</li>
|
||||
* <li>MEDIUM: Good balance between quality and performance.</li>
|
||||
* <li>HIGH: In this mode the bloom resolution is automatically increased to avoid artifacts.
|
||||
* This mode can be significantly slower on mobile, especially at high resolution.
|
||||
* This mode greatly improves the anamorphic bloom.
|
||||
* This mode greatly improves the anamorphic bloom.</li>
|
||||
* </ul>
|
||||
*/
|
||||
@NonNull
|
||||
public QualityLevel quality = QualityLevel.LOW;
|
||||
/**
|
||||
* enable screen-space lens flare
|
||||
*/
|
||||
/** enable screen-space lens flare */
|
||||
public boolean lensFlare = false;
|
||||
/**
|
||||
* enable starburst effect on lens flare
|
||||
*/
|
||||
/** enable starburst effect on lens flare */
|
||||
public boolean starburst = true;
|
||||
/**
|
||||
* amount of chromatic aberration
|
||||
*/
|
||||
/** amount of chromatic aberration */
|
||||
public float chromaticAberration = 0.005f;
|
||||
/**
|
||||
* number of flare "ghosts"
|
||||
*/
|
||||
/** number of flare "ghosts" */
|
||||
public int ghostCount = 4;
|
||||
/**
|
||||
* spacing of the ghost in screen units [0, 1[
|
||||
*/
|
||||
/** spacing of the ghost in screen units [0, 1[ */
|
||||
public float ghostSpacing = 0.6f;
|
||||
/**
|
||||
* hdr threshold for the ghosts
|
||||
*/
|
||||
/** hdr threshold for the ghosts */
|
||||
public float ghostThreshold = 10.0f;
|
||||
/**
|
||||
* thickness of halo in vertical screen units, 0 to disable
|
||||
*/
|
||||
/** thickness of halo in vertical screen units, 0 to disable */
|
||||
public float haloThickness = 0.1f;
|
||||
/**
|
||||
* radius of halo in vertical screen units [0, 0.5]
|
||||
*/
|
||||
/** radius of halo in vertical screen units [0, 0.5] */
|
||||
public float haloRadius = 0.4f;
|
||||
/**
|
||||
* hdr threshold for the halo
|
||||
*/
|
||||
/** hdr threshold for the halo */
|
||||
public float haloThreshold = 10.0f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options to control large-scale fog in the scene. Materials can enable the `linearFog` property,
|
||||
* Options to control large-scale fog in the scene. Materials can enable the <code>linearFog</code> property,
|
||||
* which uses a simplified, linear equation for fog calculation; in this mode, the heightFalloff
|
||||
* is ignored as well as the mipmap selection in IBL or skyColor mode.
|
||||
*/
|
||||
@@ -1614,12 +1611,12 @@ public class View {
|
||||
* This can be used to exclude the skybox, which is desirable if it already contains clouds or
|
||||
* fog. The default value is +infinity which applies the fog to everything.
|
||||
*
|
||||
* Note: The SkyBox is typically at a distance of 1e19 in world space (depending on the near
|
||||
* plane distance and projection used though).
|
||||
* <p>Note: The SkyBox is typically at a distance of 1e19 in world space (depending on the near
|
||||
* plane distance and projection used though).</p>
|
||||
*/
|
||||
public float cutOffDistance = Float.POSITIVE_INFINITY;
|
||||
/**
|
||||
* fog's maximum opacity between 0 and 1. Ignored in `linearFog` mode.
|
||||
* fog's maximum opacity between 0 and 1. Ignored in <code>linearFog</code> mode.
|
||||
*/
|
||||
public float maximumOpacity = 1.0f;
|
||||
/**
|
||||
@@ -1631,11 +1628,11 @@ public class View {
|
||||
* It can be expressed as 1/H, where H is the altitude change in world units [m] that causes a
|
||||
* factor 2.78 (e) change in fog density.
|
||||
*
|
||||
* A falloff of 0 means the fog density is constant everywhere and may result is slightly
|
||||
* faster computations.
|
||||
* <p>A falloff of 0 means the fog density is constant everywhere and may result is slightly
|
||||
* faster computations.</p>
|
||||
*
|
||||
* In `linearFog` mode, only use to compute the slope of the linear equation. Completely
|
||||
* ignored if set to 0.
|
||||
* <p>In <code>linearFog</code> mode, only use to compute the slope of the linear equation. Completely
|
||||
* ignored if set to 0.</p>
|
||||
*/
|
||||
public float heightFalloff = 1.0f;
|
||||
/**
|
||||
@@ -1645,11 +1642,11 @@ public class View {
|
||||
* above one are allowed but could create a non energy-conservative fog (this is dependant
|
||||
* on the IBL's intensity as well).
|
||||
*
|
||||
* We assume that our fog has no absorption and therefore all the light it scatters out
|
||||
* <p>We assume that our fog has no absorption and therefore all the light it scatters out
|
||||
* becomes ambient light in-scattering and has lost all directionality, i.e.: scattering is
|
||||
* isotropic. This somewhat simulates Rayleigh scattering.
|
||||
* isotropic. This somewhat simulates Rayleigh scattering.</p>
|
||||
*
|
||||
* This value is used as a tint instead, when fogColorFromIbl is enabled.
|
||||
* <p>This value is used as a tint instead, when fogColorFromIbl is enabled.</p>
|
||||
*
|
||||
* @see #fogColorFromIbl
|
||||
*/
|
||||
@@ -1660,20 +1657,20 @@ public class View {
|
||||
* light is absorbed and out-scattered per unit of distance. Each unit of extinction reduces
|
||||
* the incoming light to 37% of its original value.
|
||||
*
|
||||
* Note: The extinction factor is related to the fog density, it's usually some constant K times
|
||||
* <p>Note: The extinction factor is related to the fog density, it's usually some constant K times
|
||||
* the density at sea level (more specifically at fog height). The constant K depends on
|
||||
* the composition of the fog/atmosphere.
|
||||
* the composition of the fog/atmosphere.</p>
|
||||
*
|
||||
* For historical reason this parameter is called `density`.
|
||||
* <p>For historical reason this parameter is called <code>density</code>.</p>
|
||||
*
|
||||
* In `linearFog` mode this is the slope of the linear equation if heightFalloff is set to 0.
|
||||
* <p>In <code>linearFog</code> mode this is the slope of the linear equation if heightFalloff is set to 0.
|
||||
* Otherwise, heightFalloff affects the slope calculation such that it matches the slope of
|
||||
* the standard equation at the camera height.
|
||||
* the standard equation at the camera height.</p>
|
||||
*/
|
||||
public float density = 0.1f;
|
||||
/**
|
||||
* Distance in world units [m] from the camera where the Sun in-scattering starts.
|
||||
* Ignored in `linearFog` mode.
|
||||
* Ignored in <code>linearFog</code> mode.
|
||||
*/
|
||||
public float inScatteringStart = 0.0f;
|
||||
/**
|
||||
@@ -1681,16 +1678,16 @@ public class View {
|
||||
* is scattered (by the fog) towards the camera.
|
||||
* Size of the Sun in-scattering (>0 to activate). Good values are >> 1 (e.g. ~10 - 100).
|
||||
* Smaller values result is a larger scattering size.
|
||||
* Ignored in `linearFog` mode.
|
||||
* Ignored in <code>linearFog</code> mode.
|
||||
*/
|
||||
public float inScatteringSize = -1.0f;
|
||||
/**
|
||||
* The fog color will be sampled from the IBL in the view direction and tinted by `color`.
|
||||
* The fog color will be sampled from the IBL in the view direction and tinted by <code>color</code>.
|
||||
* Depending on the scene this can produce very convincing results.
|
||||
*
|
||||
* This simulates a more anisotropic phase-function.
|
||||
* <p>This simulates a more anisotropic phase-function.</p>
|
||||
*
|
||||
* `fogColorFromIbl` is ignored when skyTexture is specified.
|
||||
* <p><code>fogColorFromIbl</code> is ignored when skyTexture is specified.</p>
|
||||
*
|
||||
* @see #skyColor
|
||||
*/
|
||||
@@ -1703,11 +1700,11 @@ public class View {
|
||||
* level with a strong gaussian filter or even an irradiance filter and then generate mip
|
||||
* levels as usual. How blurred the base level is somewhat of an artistic decision.
|
||||
*
|
||||
* This simulates a more anisotropic phase-function.
|
||||
* <p>This simulates a more anisotropic phase-function.</p>
|
||||
*
|
||||
* `fogColorFromIbl` is ignored when skyTexture is specified.
|
||||
* <p><code>fogColorFromIbl</code> is ignored when skyTexture is specified.</p>
|
||||
*
|
||||
* In `linearFog` mode mipmap level 0 is always used.
|
||||
* <p>In <code>linearFog</code> mode mipmap level 0 is always used.</p>
|
||||
*
|
||||
* @see Texture
|
||||
* @see #fogColorFromIbl
|
||||
@@ -1723,9 +1720,9 @@ public class View {
|
||||
/**
|
||||
* Options to control Depth of Field (DoF) effect in the scene.
|
||||
*
|
||||
* cocScale can be used to set the depth of field blur independently of the camera
|
||||
* <p>cocScale can be used to set the depth of field blur independently of the camera
|
||||
* aperture, e.g. for artistic reasons. This can be achieved by setting:
|
||||
* cocScale = cameraAperture / desiredDoFAperture
|
||||
* cocScale = cameraAperture / desiredDoFAperture</p>
|
||||
*
|
||||
* @see Camera
|
||||
*/
|
||||
@@ -1736,59 +1733,24 @@ public class View {
|
||||
MEDIAN,
|
||||
}
|
||||
|
||||
/**
|
||||
* circle of confusion scale factor (amount of blur)
|
||||
*/
|
||||
/** circle of confusion scale factor (amount of blur) */
|
||||
public float cocScale = 1.0f;
|
||||
/**
|
||||
* width/height aspect ratio of the circle of confusion (simulate anamorphic lenses)
|
||||
*/
|
||||
/** width/height aspect ratio of the circle of confusion (simulate anamorphic lenses) */
|
||||
public float cocAspectRatio = 1.0f;
|
||||
/**
|
||||
* maximum aperture diameter in meters (zero to disable rotation)
|
||||
*/
|
||||
/** maximum aperture diameter in meters (zero to disable rotation) */
|
||||
public float maxApertureDiameter = 0.01f;
|
||||
/**
|
||||
* enable or disable depth of field effect
|
||||
*/
|
||||
/** enable or disable depth of field effect */
|
||||
public boolean enabled = false;
|
||||
/**
|
||||
* filter to use for filling gaps in the kernel
|
||||
*/
|
||||
/** filter to use for filling gaps in the kernel */
|
||||
@NonNull
|
||||
public DepthOfFieldOptions.Filter filter = DepthOfFieldOptions.Filter.MEDIAN;
|
||||
/**
|
||||
* perform DoF processing at native resolution
|
||||
*/
|
||||
/** perform DoF processing at native resolution */
|
||||
public boolean nativeResolution = false;
|
||||
/**
|
||||
* Number of of rings used by the gather kernels. The number of rings affects quality
|
||||
* and performance. The actual number of sample per pixel is defined
|
||||
* as (ringCount * 2 - 1)^2. Here are a few commonly used values:
|
||||
* 3 rings : 25 ( 5x 5 grid)
|
||||
* 4 rings : 49 ( 7x 7 grid)
|
||||
* 5 rings : 81 ( 9x 9 grid)
|
||||
* 17 rings : 1089 (33x33 grid)
|
||||
*
|
||||
* With a maximum circle-of-confusion of 32, it is never necessary to use more than 17 rings.
|
||||
*
|
||||
* Usually all three settings below are set to the same value, however, it is often
|
||||
* acceptable to use a lower ring count for the "fast tiles", which improves performance.
|
||||
* Fast tiles are regions of the screen where every pixels have a similar
|
||||
* circle-of-confusion radius.
|
||||
*
|
||||
* A value of 0 means default, which is 5 on desktop and 3 on mobile.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/** number of kernel rings for foreground tiles */
|
||||
public int foregroundRingCount = 0;
|
||||
/**
|
||||
* number of kernel rings for background tiles
|
||||
*/
|
||||
/** number of kernel rings for background tiles */
|
||||
public int backgroundRingCount = 0;
|
||||
/**
|
||||
* number of kernel rings for fast tiles
|
||||
*/
|
||||
/** number of kernel rings for fast tiles */
|
||||
public int fastGatherRingCount = 0;
|
||||
/**
|
||||
* maximum circle-of-confusion in pixels for the foreground, must be in [0, 32] range.
|
||||
@@ -1806,26 +1768,16 @@ public class View {
|
||||
* Options to control the vignetting effect.
|
||||
*/
|
||||
public static class VignetteOptions {
|
||||
/**
|
||||
* high values restrict the vignette closer to the corners, between 0 and 1
|
||||
*/
|
||||
/** high values restrict the vignette closer to the corners, between 0 and 1 */
|
||||
public float midPoint = 0.5f;
|
||||
/**
|
||||
* controls the shape of the vignette, from a rounded rectangle (0.0), to an oval (0.5), to a circle (1.0)
|
||||
*/
|
||||
/** controls the shape of the vignette, from a rounded rectangle (0.0), to an oval (0.5), to a circle (1.0) */
|
||||
public float roundness = 0.5f;
|
||||
/**
|
||||
* softening amount of the vignette effect, between 0 and 1
|
||||
*/
|
||||
/** softening amount of the vignette effect, between 0 and 1 */
|
||||
public float feather = 0.5f;
|
||||
/**
|
||||
* color of the vignette effect, alpha is currently ignored
|
||||
*/
|
||||
/** color of the vignette effect, alpha is currently ignored */
|
||||
@NonNull @Size(min = 4)
|
||||
public float[] color = {0.0f, 0.0f, 0.0f, 1.0f};
|
||||
/**
|
||||
* enables or disables the vignette effect
|
||||
*/
|
||||
/** enables or disables the vignette effect */
|
||||
public boolean enabled = false;
|
||||
}
|
||||
|
||||
@@ -1839,11 +1791,11 @@ public class View {
|
||||
/**
|
||||
* Sets the quality of the HDR color buffer.
|
||||
*
|
||||
* A quality of HIGH or ULTRA means using an RGB16F or RGBA16F color buffer. This means
|
||||
* <p>A quality of HIGH or ULTRA means using an RGB16F or RGBA16F color buffer. This means
|
||||
* colors in the LDR range (0..1) have a 10 bit precision. A quality of LOW or MEDIUM means
|
||||
* using an R11G11B10F opaque color buffer or an RGBA16F transparent color buffer. With
|
||||
* R11G11B10F colors in the LDR range have a precision of either 6 bits (red and green
|
||||
* channels) or 5 bits (blue channel).
|
||||
* channels) or 5 bits (blue channel).</p>
|
||||
*/
|
||||
@NonNull
|
||||
public QualityLevel hdrColorBuffer = QualityLevel.HIGH;
|
||||
@@ -1855,72 +1807,44 @@ public class View {
|
||||
*/
|
||||
public static class AmbientOcclusionOptions {
|
||||
public enum AmbientOcclusionType {
|
||||
/**
|
||||
* use Scalable Ambient Occlusion
|
||||
*/
|
||||
/** use Scalable Ambient Occlusion */
|
||||
SAO,
|
||||
/**
|
||||
* use Ground Truth-Based Ambient Occlusion
|
||||
*/
|
||||
/** use Ground Truth-Based Ambient Occlusion */
|
||||
GTAO,
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of ambient occlusion algorithm.
|
||||
*/
|
||||
/** Type of ambient occlusion algorithm. */
|
||||
@NonNull
|
||||
public AmbientOcclusionOptions.AmbientOcclusionType aoType = AmbientOcclusionOptions.AmbientOcclusionType.SAO;
|
||||
/**
|
||||
* Ambient Occlusion radius in meters, between 0 and ~10.
|
||||
*/
|
||||
/** Ambient Occlusion radius in meters, between 0 and ~10. */
|
||||
public float radius = 0.3f;
|
||||
/**
|
||||
* Controls ambient occlusion's contrast. Must be positive.
|
||||
*/
|
||||
/** Controls ambient occlusion's contrast. Must be positive. */
|
||||
public float power = 1.0f;
|
||||
/**
|
||||
* Self-occlusion bias in meters. Use to avoid self-occlusion.
|
||||
* Between 0 and a few mm. No effect when aoType set to GTAO
|
||||
*/
|
||||
public float bias = 0.0005f;
|
||||
/**
|
||||
* How each dimension of the AO buffer is scaled. Must be either 0.5 or 1.0.
|
||||
*/
|
||||
/** How each dimension of the AO buffer is scaled. Must be either 0.5 or 1.0. */
|
||||
public float resolution = 0.5f;
|
||||
/**
|
||||
* Strength of the Ambient Occlusion effect.
|
||||
*/
|
||||
/** Strength of the Ambient Occlusion effect. */
|
||||
public float intensity = 1.0f;
|
||||
/**
|
||||
* depth distance that constitute an edge for filtering
|
||||
*/
|
||||
/** depth distance that constitute an edge for filtering */
|
||||
public float bilateralThreshold = 0.05f;
|
||||
/**
|
||||
* affects # of samples used for AO and params for filtering
|
||||
*/
|
||||
/** affects # of samples used for AO and params for filtering */
|
||||
@NonNull
|
||||
public QualityLevel quality = QualityLevel.LOW;
|
||||
/**
|
||||
* affects AO smoothness. Recommend setting to HIGH when aoType set to GTAO.
|
||||
*/
|
||||
/** affects AO smoothness. Recommend setting to HIGH when aoType set to GTAO. */
|
||||
@NonNull
|
||||
public QualityLevel lowPassFilter = QualityLevel.MEDIUM;
|
||||
/**
|
||||
* affects AO buffer upsampling quality
|
||||
*/
|
||||
/** affects AO buffer upsampling quality */
|
||||
@NonNull
|
||||
public QualityLevel upsampling = QualityLevel.LOW;
|
||||
/**
|
||||
* enables or disables screen-space ambient occlusion
|
||||
*/
|
||||
/** enables or disables screen-space ambient occlusion */
|
||||
public boolean enabled = false;
|
||||
/**
|
||||
* enables bent normals computation from AO, and specular AO
|
||||
*/
|
||||
/** enables bent normals computation from AO, and specular AO */
|
||||
public boolean bentNormals = false;
|
||||
/**
|
||||
* min angle in radian to consider. No effect when aoType set to GTAO.
|
||||
*/
|
||||
/** min angle in radian to consider. No effect when aoType set to GTAO. */
|
||||
public float minHorizonAngleRad = 0.0f;
|
||||
/**
|
||||
* Screen Space Cone Tracing (SSCT) options
|
||||
@@ -2006,12 +1930,10 @@ public class View {
|
||||
* @see #setMultiSampleAntiAliasingOptions
|
||||
*/
|
||||
public static class MultiSampleAntiAliasingOptions {
|
||||
/**
|
||||
* enables or disables msaa
|
||||
*/
|
||||
/** enables or disables msaa */
|
||||
public boolean enabled = false;
|
||||
/**
|
||||
* sampleCount number of samples to use for multi-sampled anti-aliasing.\n
|
||||
* sampleCount number of samples to use for multi-sampled anti-aliasing.<br>
|
||||
* 0: treated as 1
|
||||
* 1: no anti-aliasing
|
||||
* n: sample count. Effective sample could be different depending on the
|
||||
@@ -2030,106 +1952,75 @@ public class View {
|
||||
* shaders to be recompiled. These options should be changed or set during initialization.
|
||||
* `filterWidth`, `feedback` and `jitterPattern`, however, can be changed at any time.
|
||||
*
|
||||
* `feedback` of 0.1 effectively accumulates a maximum of 19 samples in steady state.
|
||||
* see "A Survey of Temporal Antialiasing Techniques" by Lei Yang and all for more information.
|
||||
* <p><code>feedback</code> of 0.1 effectively accumulates a maximum of 19 samples in steady state.
|
||||
* see "A Survey of Temporal Antialiasing Techniques" by Lei Yang and all for more information.</p>
|
||||
*
|
||||
* @see #setTemporalAntiAliasingOptions
|
||||
*/
|
||||
public static class TemporalAntiAliasingOptions {
|
||||
public enum BoxType {
|
||||
/**
|
||||
* use an AABB neighborhood
|
||||
*/
|
||||
/** use an AABB neighborhood */
|
||||
AABB,
|
||||
/**
|
||||
* use both AABB and variance
|
||||
*/
|
||||
/** use both AABB and variance */
|
||||
AABB_VARIANCE,
|
||||
}
|
||||
|
||||
public enum BoxClipping {
|
||||
/**
|
||||
* Accurate box clipping
|
||||
*/
|
||||
/** Accurate box clipping */
|
||||
ACCURATE,
|
||||
/**
|
||||
* clamping
|
||||
*/
|
||||
/** clamping */
|
||||
CLAMP,
|
||||
/**
|
||||
* no rejections (use for debugging)
|
||||
*/
|
||||
/** no rejections (use for debugging) */
|
||||
NONE,
|
||||
}
|
||||
|
||||
public enum JitterPattern {
|
||||
/** 4-samples, rotated grid sampling */
|
||||
RGSS_X4,
|
||||
/** 4-samples, uniform grid in helix sequence */
|
||||
UNIFORM_HELIX_X4,
|
||||
/** 8-samples of halton 2,3 */
|
||||
HALTON_23_X8,
|
||||
/** 16-samples of halton 2,3 */
|
||||
HALTON_23_X16,
|
||||
/** 32-samples of halton 2,3 */
|
||||
HALTON_23_X32,
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated has no effect.
|
||||
*/
|
||||
/** @deprecated has no effect. */
|
||||
public float filterWidth = 1.0f;
|
||||
/**
|
||||
* history feedback, between 0 (maximum temporal AA) and 1 (no temporal AA).
|
||||
*/
|
||||
/** history feedback, between 0 (maximum temporal AA) and 1 (no temporal AA). */
|
||||
public float feedback = 0.12f;
|
||||
/**
|
||||
* texturing lod bias (typically -1 or -2)
|
||||
*/
|
||||
/** texturing lod bias (typically -1 or -2) */
|
||||
public float lodBias = -1.0f;
|
||||
/**
|
||||
* post-TAA sharpen, especially useful when upscaling is true.
|
||||
*/
|
||||
/** post-TAA sharpen, especially useful when upscaling is true. */
|
||||
public float sharpness = 0.0f;
|
||||
/**
|
||||
* enables or disables temporal anti-aliasing
|
||||
*/
|
||||
/** enables or disables temporal anti-aliasing */
|
||||
public boolean enabled = false;
|
||||
/**
|
||||
* Upscaling factor. Disables Dynamic Resolution. [BETA]
|
||||
*/
|
||||
/** Upscaling factor. Disables Dynamic Resolution. [BETA] */
|
||||
public float upscaling = 1.0f;
|
||||
/**
|
||||
* whether to filter the history buffer
|
||||
*/
|
||||
/** whether to filter the history buffer */
|
||||
public boolean filterHistory = true;
|
||||
/**
|
||||
* whether to apply the reconstruction filter to the input
|
||||
*/
|
||||
/** whether to apply the reconstruction filter to the input */
|
||||
public boolean filterInput = true;
|
||||
/**
|
||||
* whether to use the YcoCg color-space for history rejection
|
||||
*/
|
||||
/** whether to use the YcoCg color-space for history rejection */
|
||||
public boolean useYCoCg = false;
|
||||
/**
|
||||
* set to true for HDR content
|
||||
*/
|
||||
/** set to true for HDR content */
|
||||
public boolean hdr = true;
|
||||
/**
|
||||
* type of color gamut box
|
||||
*/
|
||||
/** type of color gamut box */
|
||||
@NonNull
|
||||
public TemporalAntiAliasingOptions.BoxType boxType = TemporalAntiAliasingOptions.BoxType.AABB;
|
||||
/**
|
||||
* clipping algorithm
|
||||
*/
|
||||
/** clipping algorithm */
|
||||
@NonNull
|
||||
public TemporalAntiAliasingOptions.BoxClipping boxClipping = TemporalAntiAliasingOptions.BoxClipping.ACCURATE;
|
||||
/** Jitter Pattern */
|
||||
@NonNull
|
||||
public TemporalAntiAliasingOptions.JitterPattern jitterPattern = TemporalAntiAliasingOptions.JitterPattern.HALTON_23_X16;
|
||||
/** High values increases ghosting artefact, lower values increases jittering, range [0.75, 1.25] */
|
||||
public float varianceGamma = 1.0f;
|
||||
/**
|
||||
* adjust the feedback dynamically to reduce flickering
|
||||
*/
|
||||
/** adjust the feedback dynamically to reduce flickering */
|
||||
public boolean preventFlickering = false;
|
||||
/**
|
||||
* whether to apply history reprojection (debug option)
|
||||
*/
|
||||
/** whether to apply history reprojection (debug option) */
|
||||
public boolean historyReprojection = true;
|
||||
}
|
||||
|
||||
@@ -2138,30 +2029,22 @@ public class View {
|
||||
* @see #setScreenSpaceReflectionsOptions
|
||||
*/
|
||||
public static class ScreenSpaceReflectionsOptions {
|
||||
/**
|
||||
* ray thickness, in world units
|
||||
*/
|
||||
/** ray thickness, in world units */
|
||||
public float thickness = 0.1f;
|
||||
/**
|
||||
* bias, in world units, to prevent self-intersections
|
||||
*/
|
||||
/** bias, in world units, to prevent self-intersections */
|
||||
public float bias = 0.01f;
|
||||
/**
|
||||
* maximum distance, in world units, to raycast
|
||||
*/
|
||||
/** maximum distance, in world units, to raycast */
|
||||
public float maxDistance = 3.0f;
|
||||
/**
|
||||
* stride, in texels, for samples along the ray.
|
||||
*/
|
||||
/** stride, in texels, for samples along the ray. */
|
||||
public float stride = 2.0f;
|
||||
public boolean enabled = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for the screen-space guard band.
|
||||
* A guard band can be enabled to avoid some artifacts towards the edge of the screen when
|
||||
* <p>A guard band can be enabled to avoid some artifacts towards the edge of the screen when
|
||||
* using screen-space effects such as SSAO. Enabling the guard band reduces performance slightly.
|
||||
* Currently the guard band can only be enabled or disabled.
|
||||
* Currently the guard band can only be enabled or disabled.</p>
|
||||
*/
|
||||
public static class GuardBandOptions {
|
||||
public boolean enabled = false;
|
||||
@@ -2174,13 +2057,9 @@ public class View {
|
||||
* @see #setSampleCount
|
||||
*/
|
||||
public enum AntiAliasing {
|
||||
/**
|
||||
* no anti aliasing performed as part of post-processing
|
||||
*/
|
||||
/** no anti aliasing performed as part of post-processing */
|
||||
NONE,
|
||||
/**
|
||||
* FXAA is a low-quality but very efficient type of anti-aliasing. (default).
|
||||
*/
|
||||
/** FXAA is a low-quality but very efficient type of anti-aliasing. (default). */
|
||||
FXAA,
|
||||
}
|
||||
|
||||
@@ -2188,13 +2067,9 @@ public class View {
|
||||
* List of available post-processing dithering techniques.
|
||||
*/
|
||||
public enum Dithering {
|
||||
/**
|
||||
* No dithering
|
||||
*/
|
||||
/** No dithering */
|
||||
NONE,
|
||||
/**
|
||||
* Temporal dithering (default)
|
||||
*/
|
||||
/** Temporal dithering (default) */
|
||||
TEMPORAL,
|
||||
}
|
||||
|
||||
@@ -2203,21 +2078,13 @@ public class View {
|
||||
* @see #setShadowType
|
||||
*/
|
||||
public enum ShadowType {
|
||||
/**
|
||||
* percentage-closer filtered shadows (default)
|
||||
*/
|
||||
/** percentage-closer filtered shadows (default) */
|
||||
PCF,
|
||||
/**
|
||||
* variance shadows
|
||||
*/
|
||||
/** variance shadows */
|
||||
VSM,
|
||||
/**
|
||||
* PCF with contact hardening simulation
|
||||
*/
|
||||
/** PCF with contact hardening simulation */
|
||||
DPCF,
|
||||
/**
|
||||
* PCF with soft shadows and contact hardening
|
||||
*/
|
||||
/** PCF with soft shadows and contact hardening */
|
||||
PCSS,
|
||||
PCFd,
|
||||
}
|
||||
@@ -2225,14 +2092,14 @@ public class View {
|
||||
/**
|
||||
* View-level options for VSM Shadowing.
|
||||
* @see #setVsmShadowOptions
|
||||
* @warning This API is still experimental and subject to change.
|
||||
* <b>Warning:</b> This API is still experimental and subject to change.
|
||||
*/
|
||||
public static class VsmShadowOptions {
|
||||
/**
|
||||
* Sets the number of anisotropic samples to use when sampling a VSM shadow map. If greater
|
||||
* than 0, mipmaps will automatically be generated each frame for all lights.
|
||||
*
|
||||
* The number of anisotropic samples = 2 ^ vsmAnisotropy.
|
||||
* <p>The number of anisotropic samples = 2 ^ vsmAnisotropy.</p>
|
||||
*/
|
||||
public int anisotropy = 0;
|
||||
/**
|
||||
@@ -2266,7 +2133,7 @@ public class View {
|
||||
/**
|
||||
* View-level options for DPCF and PCSS Shadowing.
|
||||
* @see #setSoftShadowOptions
|
||||
* @warning This API is still experimental and subject to change.
|
||||
* <b>Warning:</b> This API is still experimental and subject to change.
|
||||
*/
|
||||
public static class SoftShadowOptions {
|
||||
/**
|
||||
|
||||
@@ -50,51 +50,60 @@ enum class BlendMode : uint8_t {
|
||||
* by lowering the resolution of a View, or to increase the quality when the
|
||||
* rendering is faster than the target frame rate.
|
||||
*
|
||||
* This structure can be used to specify the minimum scale factor used when
|
||||
* <p>This structure can be used to specify the minimum scale factor used when
|
||||
* lowering the resolution of a View, and the maximum scale factor used when
|
||||
* increasing the resolution for higher quality rendering. The scale factors
|
||||
* can be controlled on each X and Y axis independently. By default, all scale
|
||||
* factors are set to 1.0.
|
||||
* factors are set to 1.0.</p>
|
||||
*
|
||||
* enabled: enable or disables dynamic resolution on a View
|
||||
* <ul>
|
||||
* <li>enabled: enable or disables dynamic resolution on a View</li>
|
||||
*
|
||||
* homogeneousScaling: by default the system scales the major axis first. Set this to true
|
||||
* to force homogeneous scaling.
|
||||
* <li>homogeneousScaling: by default the system scales the major axis first. Set this to true
|
||||
* to force homogeneous scaling.</li>
|
||||
*
|
||||
* minScale: the minimum scale in X and Y this View should use
|
||||
* <li>minScale: the minimum scale in X and Y this View should use</li>
|
||||
*
|
||||
* maxScale: the maximum scale in X and Y this View should use
|
||||
* <li>maxScale: the maximum scale in X and Y this View should use</li>
|
||||
*
|
||||
* quality: upscaling quality.
|
||||
* LOW: 1 bilinear tap, Medium: 4 bilinear taps, High: 9 bilinear taps (tent)
|
||||
* <li>quality: upscaling quality.
|
||||
* LOW: 1 bilinear tap, Medium: 4 bilinear taps, High: 9 bilinear taps (tent)</li>
|
||||
* </ul>
|
||||
*
|
||||
* \note
|
||||
* <p>Note:
|
||||
* Dynamic resolution is only supported on platforms where the time to render
|
||||
* a frame can be measured accurately. On platforms where this is not supported,
|
||||
* Dynamic Resolution can't be enabled unless minScale == maxScale.
|
||||
* Dynamic Resolution can't be enabled unless <code>minScale == maxScale</code>.</p>
|
||||
*
|
||||
* @see Renderer::FrameRateOptions
|
||||
* @see Renderer.FrameRateOptions
|
||||
*
|
||||
*/
|
||||
struct DynamicResolutionOptions {
|
||||
math::float2 minScale = {0.5f, 0.5f}; //!< minimum scale factors in x and y %codegen_java_float%
|
||||
math::float2 maxScale = {1.0f, 1.0f}; //!< maximum scale factors in x and y %codegen_java_float%
|
||||
float sharpness = 0.9f; //!< sharpness when QualityLevel::MEDIUM or higher is used [0 (disabled), 1 (sharpest)]
|
||||
bool enabled = false; //!< enable or disable dynamic resolution
|
||||
bool homogeneousScaling = false; //!< set to true to force homogeneous scaling
|
||||
/** minimum scale factors in x and y */
|
||||
math::float2 minScale = {0.5f, 0.5f}; // %codegen_java_float%
|
||||
/** maximum scale factors in x and y */
|
||||
math::float2 maxScale = {1.0f, 1.0f}; // %codegen_java_float%
|
||||
/** sharpness when QualityLevel::MEDIUM or higher is used [0 (disabled), 1 (sharpest)] */
|
||||
float sharpness = 0.9f;
|
||||
/** enable or disable dynamic resolution */
|
||||
bool enabled = false;
|
||||
/** set to true to force homogeneous scaling */
|
||||
bool homogeneousScaling = false;
|
||||
|
||||
/**
|
||||
* Upscaling quality
|
||||
* LOW: bilinear filtered blit. Fastest, poor quality
|
||||
* MEDIUM: Qualcomm Snapdragon Game Super Resolution (SGSR) 1.0
|
||||
* HIGH: AMD FidelityFX FSR1 w/ mobile optimizations
|
||||
* ULTRA: AMD FidelityFX FSR1
|
||||
* <ul>
|
||||
* <li>LOW: bilinear filtered blit. Fastest, poor quality</li>
|
||||
* <li>MEDIUM: Qualcomm Snapdragon Game Super Resolution (SGSR) 1.0</li>
|
||||
* <li>HIGH: AMD FidelityFX FSR1 w/ mobile optimizations</li>
|
||||
* <li>ULTRA: AMD FidelityFX FSR1</li>
|
||||
* </ul>
|
||||
* FSR1 and SGSR require a well anti-aliased (MSAA or TAA), noise free scene.
|
||||
* Avoid FXAA and dithering.
|
||||
*
|
||||
* The default upscaling quality is set to LOW.
|
||||
* <p>The default upscaling quality is set to LOW.</p>
|
||||
*
|
||||
* caveat: currently, 'quality' is always set to LOW if the View is TRANSLUCENT.
|
||||
* <p>caveat: currently, <code>quality</code> is always set to LOW if the View is TRANSLUCENT.</p>
|
||||
*/
|
||||
QualityLevel quality = QualityLevel::LOW;
|
||||
};
|
||||
@@ -102,72 +111,96 @@ struct DynamicResolutionOptions {
|
||||
/**
|
||||
* Options to control the bloom effect
|
||||
*
|
||||
* enabled: Enable or disable the bloom post-processing effect. Disabled by default.
|
||||
* <ul>
|
||||
* <li>enabled: Enable or disable the bloom post-processing effect. Disabled by default.</li>
|
||||
*
|
||||
* levels: Number of successive blurs to achieve the blur effect, the minimum is 3 and the
|
||||
* <li>levels: Number of successive blurs to achieve the blur effect, the minimum is 3 and the
|
||||
* maximum is 12. This value together with resolution influences the spread of the
|
||||
* blur effect. This value can be silently reduced to accommodate the original
|
||||
* image size.
|
||||
* image size.</li>
|
||||
*
|
||||
* resolution: Resolution of bloom's minor axis. The minimum value is 2^levels and the
|
||||
* <li>resolution: Resolution of bloom's minor axis. The minimum value is 2^levels and the
|
||||
* the maximum is lower of the original resolution and 4096. This parameter is
|
||||
* silently clamped to the minimum and maximum.
|
||||
* It is highly recommended that this value be smaller than the target resolution
|
||||
* after dynamic resolution is applied (horizontally and vertically).
|
||||
* after dynamic resolution is applied (horizontally and vertically).</li>
|
||||
*
|
||||
* strength: how much of the bloom is added to the original image. Between 0 and 1.
|
||||
* <li>strength: how much of the bloom is added to the original image. Between 0 and 1.</li>
|
||||
*
|
||||
* blendMode: Whether the bloom effect is purely additive (false) or mixed with the original
|
||||
* image (true).
|
||||
* <li>blendMode: Whether the bloom effect is purely additive (false) or mixed with the original
|
||||
* image (true).</li>
|
||||
*
|
||||
* threshold: When enabled, a threshold at 1.0 is applied on the source image, this is
|
||||
* useful for artistic reasons and is usually needed when a dirt texture is used.
|
||||
* <li>threshold: When enabled, a threshold at 1.0 is applied on the source image, this is
|
||||
* useful for artistic reasons and is usually needed when a dirt texture is used.</li>
|
||||
*
|
||||
* dirt: A dirt/scratch/smudges texture (that can be RGB), which gets added to the
|
||||
* <li>dirt: A dirt/scratch/smudges texture (that can be RGB), which gets added to the
|
||||
* bloom effect. Smudges are visible where bloom occurs. Threshold must be
|
||||
* enabled for the dirt effect to work properly.
|
||||
* enabled for the dirt effect to work properly.</li>
|
||||
*
|
||||
* dirtStrength: Strength of the dirt texture.
|
||||
* <li>dirtStrength: Strength of the dirt texture.</li>
|
||||
* </ul>
|
||||
*/
|
||||
struct BloomOptions {
|
||||
enum class BlendMode : uint8_t {
|
||||
ADD, //!< Bloom is modulated by the strength parameter and added to the scene
|
||||
INTERPOLATE //!< Bloom is interpolated with the scene using the strength parameter
|
||||
/** Bloom is modulated by the strength parameter and added to the scene */
|
||||
ADD,
|
||||
/** Bloom is interpolated with the scene using the strength parameter */
|
||||
INTERPOLATE
|
||||
};
|
||||
Texture* dirt = nullptr; //!< user provided dirt texture %codegen_skip_json% %codegen_skip_javascript%
|
||||
float dirtStrength = 0.2f; //!< strength of the dirt texture %codegen_skip_json% %codegen_skip_javascript%
|
||||
float strength = 0.10f; //!< bloom's strength between 0.0 and 1.0
|
||||
uint32_t resolution = 384; //!< resolution of vertical axis (2^levels to 2048)
|
||||
uint8_t levels = 6; //!< number of blur levels (1 to 11)
|
||||
BlendMode blendMode = BlendMode::ADD; //!< how the bloom effect is applied
|
||||
bool threshold = true; //!< whether to threshold the source
|
||||
bool enabled = false; //!< enable or disable bloom
|
||||
float highlight = 1000.0f; //!< limit highlights to this value before bloom [10, +inf]
|
||||
/** user provided dirt texture */
|
||||
Texture* dirt = nullptr; // %codegen_skip_json% %codegen_skip_javascript%
|
||||
/** strength of the dirt texture */
|
||||
float dirtStrength = 0.2f; // %codegen_skip_json% %codegen_skip_javascript%
|
||||
/** bloom's strength between 0.0 and 1.0 */
|
||||
float strength = 0.10f;
|
||||
/** resolution of vertical axis (2^levels to 2048) */
|
||||
uint32_t resolution = 384;
|
||||
/** number of blur levels (1 to 11) */
|
||||
uint8_t levels = 6;
|
||||
/** how the bloom effect is applied */
|
||||
BlendMode blendMode = BlendMode::ADD;
|
||||
/** whether to threshold the source */
|
||||
bool threshold = true;
|
||||
/** enable or disable bloom */
|
||||
bool enabled = false;
|
||||
/** limit highlights to this value before bloom [10, +inf] */
|
||||
float highlight = 1000.0f;
|
||||
|
||||
/**
|
||||
* Bloom quality level.
|
||||
* LOW (default): use a more optimized down-sampling filter, however there can be artifacts
|
||||
* with dynamic resolution, this can be alleviated by using the homogenous mode.
|
||||
* MEDIUM: Good balance between quality and performance.
|
||||
* HIGH: In this mode the bloom resolution is automatically increased to avoid artifacts.
|
||||
* <ul>
|
||||
* <li>LOW (default): use a more optimized down-sampling filter, however there can be artifacts
|
||||
* with dynamic resolution, this can be alleviated by using the homogenous mode.</li>
|
||||
* <li>MEDIUM: Good balance between quality and performance.</li>
|
||||
* <li>HIGH: In this mode the bloom resolution is automatically increased to avoid artifacts.
|
||||
* This mode can be significantly slower on mobile, especially at high resolution.
|
||||
* This mode greatly improves the anamorphic bloom.
|
||||
* This mode greatly improves the anamorphic bloom.</li>
|
||||
* </ul>
|
||||
*/
|
||||
QualityLevel quality = QualityLevel::LOW;
|
||||
|
||||
bool lensFlare = false; //!< enable screen-space lens flare
|
||||
bool starburst = true; //!< enable starburst effect on lens flare
|
||||
float chromaticAberration = 0.005f; //!< amount of chromatic aberration
|
||||
uint8_t ghostCount = 4; //!< number of flare "ghosts"
|
||||
float ghostSpacing = 0.6f; //!< spacing of the ghost in screen units [0, 1[
|
||||
float ghostThreshold = 10.0f; //!< hdr threshold for the ghosts
|
||||
float haloThickness = 0.1f; //!< thickness of halo in vertical screen units, 0 to disable
|
||||
float haloRadius = 0.4f; //!< radius of halo in vertical screen units [0, 0.5]
|
||||
float haloThreshold = 10.0f; //!< hdr threshold for the halo
|
||||
/** enable screen-space lens flare */
|
||||
bool lensFlare = false;
|
||||
/** enable starburst effect on lens flare */
|
||||
bool starburst = true;
|
||||
/** amount of chromatic aberration */
|
||||
float chromaticAberration = 0.005f;
|
||||
/** number of flare "ghosts" */
|
||||
uint8_t ghostCount = 4;
|
||||
/** spacing of the ghost in screen units [0, 1[ */
|
||||
float ghostSpacing = 0.6f;
|
||||
/** hdr threshold for the ghosts */
|
||||
float ghostThreshold = 10.0f;
|
||||
/** thickness of halo in vertical screen units, 0 to disable */
|
||||
float haloThickness = 0.1f;
|
||||
/** radius of halo in vertical screen units [0, 0.5] */
|
||||
float haloRadius = 0.4f;
|
||||
/** hdr threshold for the halo */
|
||||
float haloThreshold = 10.0f;
|
||||
};
|
||||
|
||||
/**
|
||||
* Options to control large-scale fog in the scene. Materials can enable the `linearFog` property,
|
||||
* Options to control large-scale fog in the scene. Materials can enable the <code>linearFog</code> property,
|
||||
* which uses a simplified, linear equation for fog calculation; in this mode, the heightFalloff
|
||||
* is ignored as well as the mipmap selection in IBL or skyColor mode.
|
||||
*/
|
||||
@@ -182,13 +215,13 @@ struct FogOptions {
|
||||
* This can be used to exclude the skybox, which is desirable if it already contains clouds or
|
||||
* fog. The default value is +infinity which applies the fog to everything.
|
||||
*
|
||||
* Note: The SkyBox is typically at a distance of 1e19 in world space (depending on the near
|
||||
* plane distance and projection used though).
|
||||
* <p>Note: The SkyBox is typically at a distance of 1e19 in world space (depending on the near
|
||||
* plane distance and projection used though).</p>
|
||||
*/
|
||||
float cutOffDistance = INFINITY;
|
||||
|
||||
/**
|
||||
* fog's maximum opacity between 0 and 1. Ignored in `linearFog` mode.
|
||||
* fog's maximum opacity between 0 and 1. Ignored in <code>linearFog</code> mode.
|
||||
*/
|
||||
float maximumOpacity = 1.0f;
|
||||
|
||||
@@ -202,11 +235,11 @@ struct FogOptions {
|
||||
* It can be expressed as 1/H, where H is the altitude change in world units [m] that causes a
|
||||
* factor 2.78 (e) change in fog density.
|
||||
*
|
||||
* A falloff of 0 means the fog density is constant everywhere and may result is slightly
|
||||
* faster computations.
|
||||
* <p>A falloff of 0 means the fog density is constant everywhere and may result is slightly
|
||||
* faster computations.</p>
|
||||
*
|
||||
* In `linearFog` mode, only use to compute the slope of the linear equation. Completely
|
||||
* ignored if set to 0.
|
||||
* <p>In <code>linearFog</code> mode, only use to compute the slope of the linear equation. Completely
|
||||
* ignored if set to 0.</p>
|
||||
*/
|
||||
float heightFalloff = 1.0f;
|
||||
|
||||
@@ -217,13 +250,13 @@ struct FogOptions {
|
||||
* above one are allowed but could create a non energy-conservative fog (this is dependant
|
||||
* on the IBL's intensity as well).
|
||||
*
|
||||
* We assume that our fog has no absorption and therefore all the light it scatters out
|
||||
* <p>We assume that our fog has no absorption and therefore all the light it scatters out
|
||||
* becomes ambient light in-scattering and has lost all directionality, i.e.: scattering is
|
||||
* isotropic. This somewhat simulates Rayleigh scattering.
|
||||
* isotropic. This somewhat simulates Rayleigh scattering.</p>
|
||||
*
|
||||
* This value is used as a tint instead, when fogColorFromIbl is enabled.
|
||||
* <p>This value is used as a tint instead, when fogColorFromIbl is enabled.</p>
|
||||
*
|
||||
* @see fogColorFromIbl
|
||||
* @see #fogColorFromIbl
|
||||
*/
|
||||
LinearColor color = { 1.0f, 1.0f, 1.0f };
|
||||
|
||||
@@ -232,21 +265,21 @@ struct FogOptions {
|
||||
* light is absorbed and out-scattered per unit of distance. Each unit of extinction reduces
|
||||
* the incoming light to 37% of its original value.
|
||||
*
|
||||
* Note: The extinction factor is related to the fog density, it's usually some constant K times
|
||||
* <p>Note: The extinction factor is related to the fog density, it's usually some constant K times
|
||||
* the density at sea level (more specifically at fog height). The constant K depends on
|
||||
* the composition of the fog/atmosphere.
|
||||
* the composition of the fog/atmosphere.</p>
|
||||
*
|
||||
* For historical reason this parameter is called `density`.
|
||||
* <p>For historical reason this parameter is called <code>density</code>.</p>
|
||||
*
|
||||
* In `linearFog` mode this is the slope of the linear equation if heightFalloff is set to 0.
|
||||
* <p>In <code>linearFog</code> mode this is the slope of the linear equation if heightFalloff is set to 0.
|
||||
* Otherwise, heightFalloff affects the slope calculation such that it matches the slope of
|
||||
* the standard equation at the camera height.
|
||||
* the standard equation at the camera height.</p>
|
||||
*/
|
||||
float density = 0.1f;
|
||||
|
||||
/**
|
||||
* Distance in world units [m] from the camera where the Sun in-scattering starts.
|
||||
* Ignored in `linearFog` mode.
|
||||
* Ignored in <code>linearFog</code> mode.
|
||||
*/
|
||||
float inScatteringStart = 0.0f;
|
||||
|
||||
@@ -255,19 +288,19 @@ struct FogOptions {
|
||||
* is scattered (by the fog) towards the camera.
|
||||
* Size of the Sun in-scattering (>0 to activate). Good values are >> 1 (e.g. ~10 - 100).
|
||||
* Smaller values result is a larger scattering size.
|
||||
* Ignored in `linearFog` mode.
|
||||
* Ignored in <code>linearFog</code> mode.
|
||||
*/
|
||||
float inScatteringSize = -1.0f;
|
||||
|
||||
/**
|
||||
* The fog color will be sampled from the IBL in the view direction and tinted by `color`.
|
||||
* The fog color will be sampled from the IBL in the view direction and tinted by <code>color</code>.
|
||||
* Depending on the scene this can produce very convincing results.
|
||||
*
|
||||
* This simulates a more anisotropic phase-function.
|
||||
* <p>This simulates a more anisotropic phase-function.</p>
|
||||
*
|
||||
* `fogColorFromIbl` is ignored when skyTexture is specified.
|
||||
* <p><code>fogColorFromIbl</code> is ignored when skyTexture is specified.</p>
|
||||
*
|
||||
* @see skyColor
|
||||
* @see #skyColor
|
||||
*/
|
||||
bool fogColorFromIbl = false;
|
||||
|
||||
@@ -279,16 +312,16 @@ struct FogOptions {
|
||||
* level with a strong gaussian filter or even an irradiance filter and then generate mip
|
||||
* levels as usual. How blurred the base level is somewhat of an artistic decision.
|
||||
*
|
||||
* This simulates a more anisotropic phase-function.
|
||||
* <p>This simulates a more anisotropic phase-function.</p>
|
||||
*
|
||||
* `fogColorFromIbl` is ignored when skyTexture is specified.
|
||||
* <p><code>fogColorFromIbl</code> is ignored when skyTexture is specified.</p>
|
||||
*
|
||||
* In `linearFog` mode mipmap level 0 is always used.
|
||||
* <p>In <code>linearFog</code> mode mipmap level 0 is always used.</p>
|
||||
*
|
||||
* @see Texture
|
||||
* @see fogColorFromIbl
|
||||
* @see #fogColorFromIbl
|
||||
*/
|
||||
Texture* skyColor = nullptr; //!< %codegen_skip_json% %codegen_skip_javascript%
|
||||
Texture* skyColor = nullptr; // %codegen_skip_json% %codegen_skip_javascript%
|
||||
|
||||
/**
|
||||
* Enable or disable large-scale fog
|
||||
@@ -299,9 +332,9 @@ struct FogOptions {
|
||||
/**
|
||||
* Options to control Depth of Field (DoF) effect in the scene.
|
||||
*
|
||||
* cocScale can be used to set the depth of field blur independently of the camera
|
||||
* <p>cocScale can be used to set the depth of field blur independently of the camera
|
||||
* aperture, e.g. for artistic reasons. This can be achieved by setting:
|
||||
* cocScale = cameraAperture / desiredDoFAperture
|
||||
* cocScale = cameraAperture / desiredDoFAperture</p>
|
||||
*
|
||||
* @see Camera
|
||||
*/
|
||||
@@ -311,36 +344,47 @@ struct DepthOfFieldOptions {
|
||||
UNUSED,
|
||||
MEDIAN
|
||||
};
|
||||
float cocScale = 1.0f; //!< circle of confusion scale factor (amount of blur)
|
||||
float cocAspectRatio = 1.0f; //!< width/height aspect ratio of the circle of confusion (simulate anamorphic lenses)
|
||||
float maxApertureDiameter = 0.01f; //!< maximum aperture diameter in meters (zero to disable rotation)
|
||||
bool enabled = false; //!< enable or disable depth of field effect
|
||||
Filter filter = Filter::MEDIAN; //!< filter to use for filling gaps in the kernel
|
||||
bool nativeResolution = false; //!< perform DoF processing at native resolution
|
||||
/** circle of confusion scale factor (amount of blur) */
|
||||
float cocScale = 1.0f;
|
||||
/** width/height aspect ratio of the circle of confusion (simulate anamorphic lenses) */
|
||||
float cocAspectRatio = 1.0f;
|
||||
/** maximum aperture diameter in meters (zero to disable rotation) */
|
||||
float maxApertureDiameter = 0.01f;
|
||||
/** enable or disable depth of field effect */
|
||||
bool enabled = false;
|
||||
/** filter to use for filling gaps in the kernel */
|
||||
Filter filter = Filter::MEDIAN;
|
||||
/** perform DoF processing at native resolution */
|
||||
bool nativeResolution = false;
|
||||
/**
|
||||
* Number of of rings used by the gather kernels. The number of rings affects quality
|
||||
* and performance. The actual number of sample per pixel is defined
|
||||
* as (ringCount * 2 - 1)^2. Here are a few commonly used values:
|
||||
* 3 rings : 25 ( 5x 5 grid)
|
||||
* 4 rings : 49 ( 7x 7 grid)
|
||||
* 5 rings : 81 ( 9x 9 grid)
|
||||
* 17 rings : 1089 (33x33 grid)
|
||||
* <ul>
|
||||
* <li>3 rings : 25 ( 5x 5 grid)</li>
|
||||
* <li>4 rings : 49 ( 7x 7 grid)</li>
|
||||
* <li>5 rings : 81 ( 9x 9 grid)</li>
|
||||
* <li>17 rings : 1089 (33x33 grid)</li>
|
||||
* </ul>
|
||||
*
|
||||
* With a maximum circle-of-confusion of 32, it is never necessary to use more than 17 rings.
|
||||
* <p>With a maximum circle-of-confusion of 32, it is never necessary to use more than 17 rings.</p>
|
||||
*
|
||||
* Usually all three settings below are set to the same value, however, it is often
|
||||
* <p>Usually all three settings below are set to the same value, however, it is often
|
||||
* acceptable to use a lower ring count for the "fast tiles", which improves performance.
|
||||
* Fast tiles are regions of the screen where every pixels have a similar
|
||||
* circle-of-confusion radius.
|
||||
* circle-of-confusion radius.</p>
|
||||
*
|
||||
* A value of 0 means default, which is 5 on desktop and 3 on mobile.
|
||||
* <p>A value of 0 means default, which is 5 on desktop and 3 on mobile.</p>
|
||||
*
|
||||
* @{
|
||||
* @see #backgroundRingCount
|
||||
* @see #fastGatherRingCount
|
||||
*/
|
||||
uint8_t foregroundRingCount = 0; //!< number of kernel rings for foreground tiles
|
||||
uint8_t backgroundRingCount = 0; //!< number of kernel rings for background tiles
|
||||
uint8_t fastGatherRingCount = 0; //!< number of kernel rings for fast tiles
|
||||
/** @}*/
|
||||
/** number of kernel rings for foreground tiles */
|
||||
uint8_t foregroundRingCount = 0;
|
||||
/** number of kernel rings for background tiles */
|
||||
uint8_t backgroundRingCount = 0;
|
||||
/** number of kernel rings for fast tiles */
|
||||
uint8_t fastGatherRingCount = 0;
|
||||
|
||||
/**
|
||||
* maximum circle-of-confusion in pixels for the foreground, must be in [0, 32] range.
|
||||
@@ -359,44 +403,55 @@ struct DepthOfFieldOptions {
|
||||
* Options to control the vignetting effect.
|
||||
*/
|
||||
struct VignetteOptions {
|
||||
float midPoint = 0.5f; //!< high values restrict the vignette closer to the corners, between 0 and 1
|
||||
float roundness = 0.5f; //!< controls the shape of the vignette, from a rounded rectangle (0.0), to an oval (0.5), to a circle (1.0)
|
||||
float feather = 0.5f; //!< softening amount of the vignette effect, between 0 and 1
|
||||
LinearColorA color = {0.0f, 0.0f, 0.0f, 1.0f}; //!< color of the vignette effect, alpha is currently ignored
|
||||
bool enabled = false; //!< enables or disables the vignette effect
|
||||
/** high values restrict the vignette closer to the corners, between 0 and 1 */
|
||||
float midPoint = 0.5f;
|
||||
/** controls the shape of the vignette, from a rounded rectangle (0.0), to an oval (0.5), to a circle (1.0) */
|
||||
float roundness = 0.5f;
|
||||
/** softening amount of the vignette effect, between 0 and 1 */
|
||||
float feather = 0.5f;
|
||||
/** color of the vignette effect, alpha is currently ignored */
|
||||
LinearColorA color = {0.0f, 0.0f, 0.0f, 1.0f};
|
||||
/** enables or disables the vignette effect */
|
||||
bool enabled = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Structure used to set the precision of the color buffer and related quality settings.
|
||||
*
|
||||
* @see setRenderQuality, getRenderQuality
|
||||
* @see #setRenderQuality
|
||||
* @see #getRenderQuality
|
||||
*/
|
||||
struct RenderQuality {
|
||||
/**
|
||||
* Sets the quality of the HDR color buffer.
|
||||
*
|
||||
* A quality of HIGH or ULTRA means using an RGB16F or RGBA16F color buffer. This means
|
||||
* <p>A quality of HIGH or ULTRA means using an RGB16F or RGBA16F color buffer. This means
|
||||
* colors in the LDR range (0..1) have a 10 bit precision. A quality of LOW or MEDIUM means
|
||||
* using an R11G11B10F opaque color buffer or an RGBA16F transparent color buffer. With
|
||||
* R11G11B10F colors in the LDR range have a precision of either 6 bits (red and green
|
||||
* channels) or 5 bits (blue channel).
|
||||
* channels) or 5 bits (blue channel).</p>
|
||||
*/
|
||||
QualityLevel hdrColorBuffer = QualityLevel::HIGH;
|
||||
};
|
||||
|
||||
/**
|
||||
* Options for screen space Ambient Occlusion (SSAO) and Screen Space Cone Tracing (SSCT)
|
||||
* @see setAmbientOcclusionOptions()
|
||||
* @see #setAmbientOcclusionOptions
|
||||
*/
|
||||
struct AmbientOcclusionOptions {
|
||||
enum class AmbientOcclusionType : uint8_t {
|
||||
SAO, //!< use Scalable Ambient Occlusion
|
||||
GTAO, //!< use Ground Truth-Based Ambient Occlusion
|
||||
/** use Scalable Ambient Occlusion */
|
||||
SAO,
|
||||
/** use Ground Truth-Based Ambient Occlusion */
|
||||
GTAO,
|
||||
};
|
||||
|
||||
AmbientOcclusionType aoType = AmbientOcclusionType::SAO;//!< Type of ambient occlusion algorithm.
|
||||
float radius = 0.3f; //!< Ambient Occlusion radius in meters, between 0 and ~10.
|
||||
float power = 1.0f; //!< Controls ambient occlusion's contrast. Must be positive.
|
||||
/** Type of ambient occlusion algorithm. */
|
||||
AmbientOcclusionType aoType = AmbientOcclusionType::SAO;
|
||||
/** Ambient Occlusion radius in meters, between 0 and ~10. */
|
||||
float radius = 0.3f;
|
||||
/** Controls ambient occlusion's contrast. Must be positive. */
|
||||
float power = 1.0f;
|
||||
|
||||
/**
|
||||
* Self-occlusion bias in meters. Use to avoid self-occlusion.
|
||||
@@ -404,30 +459,49 @@ struct AmbientOcclusionOptions {
|
||||
*/
|
||||
float bias = 0.0005f;
|
||||
|
||||
float resolution = 0.5f;//!< How each dimension of the AO buffer is scaled. Must be either 0.5 or 1.0.
|
||||
float intensity = 1.0f; //!< Strength of the Ambient Occlusion effect.
|
||||
float bilateralThreshold = 0.05f; //!< depth distance that constitute an edge for filtering
|
||||
QualityLevel quality = QualityLevel::LOW; //!< affects # of samples used for AO and params for filtering
|
||||
QualityLevel lowPassFilter = QualityLevel::MEDIUM; //!< affects AO smoothness. Recommend setting to HIGH when aoType set to GTAO.
|
||||
QualityLevel upsampling = QualityLevel::LOW; //!< affects AO buffer upsampling quality
|
||||
bool enabled = false; //!< enables or disables screen-space ambient occlusion
|
||||
bool bentNormals = false; //!< enables bent normals computation from AO, and specular AO
|
||||
float minHorizonAngleRad = 0.0f; //!< min angle in radian to consider. No effect when aoType set to GTAO.
|
||||
/** How each dimension of the AO buffer is scaled. Must be either 0.5 or 1.0. */
|
||||
float resolution = 0.5f;
|
||||
/** Strength of the Ambient Occlusion effect. */
|
||||
float intensity = 1.0f;
|
||||
/** depth distance that constitute an edge for filtering */
|
||||
float bilateralThreshold = 0.05f;
|
||||
/** affects # of samples used for AO and params for filtering */
|
||||
QualityLevel quality = QualityLevel::LOW;
|
||||
/** affects AO smoothness. Recommend setting to HIGH when aoType set to GTAO. */
|
||||
QualityLevel lowPassFilter = QualityLevel::MEDIUM;
|
||||
/** affects AO buffer upsampling quality */
|
||||
QualityLevel upsampling = QualityLevel::LOW;
|
||||
/** enables or disables screen-space ambient occlusion */
|
||||
bool enabled = false;
|
||||
/** enables bent normals computation from AO, and specular AO */
|
||||
bool bentNormals = false;
|
||||
/** min angle in radian to consider. No effect when aoType set to GTAO. */
|
||||
float minHorizonAngleRad = 0.0f;
|
||||
/**
|
||||
* Screen Space Cone Tracing (SSCT) options
|
||||
* Ambient shadows from dominant light
|
||||
*/
|
||||
struct Ssct {
|
||||
float lightConeRad = 1.0f; //!< full cone angle in radian, between 0 and pi/2
|
||||
float shadowDistance = 0.3f; //!< how far shadows can be cast
|
||||
float contactDistanceMax = 1.0f; //!< max distance for contact
|
||||
float intensity = 0.8f; //!< intensity
|
||||
math::float3 lightDirection = { 0, -1, 0 }; //!< light direction
|
||||
float depthBias = 0.01f; //!< depth bias in world units (mitigate self shadowing)
|
||||
float depthSlopeBias = 0.01f; //!< depth slope bias (mitigate self shadowing)
|
||||
uint8_t sampleCount = 4; //!< tracing sample count, between 1 and 255
|
||||
uint8_t rayCount = 1; //!< # of rays to trace, between 1 and 255
|
||||
bool enabled = false; //!< enables or disables SSCT
|
||||
/** full cone angle in radian, between 0 and pi/2 */
|
||||
float lightConeRad = 1.0f;
|
||||
/** how far shadows can be cast */
|
||||
float shadowDistance = 0.3f;
|
||||
/** max distance for contact */
|
||||
float contactDistanceMax = 1.0f;
|
||||
/** intensity */
|
||||
float intensity = 0.8f;
|
||||
/** light direction */
|
||||
math::float3 lightDirection = { 0, -1, 0 };
|
||||
/** depth bias in world units (mitigate self shadowing) */
|
||||
float depthBias = 0.01f;
|
||||
/** depth slope bias (mitigate self shadowing) */
|
||||
float depthSlopeBias = 0.01f;
|
||||
/** tracing sample count, between 1 and 255 */
|
||||
uint8_t sampleCount = 4;
|
||||
/** # of rays to trace, between 1 and 255 */
|
||||
uint8_t rayCount = 1;
|
||||
/** enables or disables SSCT */
|
||||
bool enabled = false;
|
||||
};
|
||||
Ssct ssct; // %codegen_skip_javascript% %codegen_java_flatten%
|
||||
|
||||
@@ -435,16 +509,20 @@ struct AmbientOcclusionOptions {
|
||||
* Ground Truth-base Ambient Occlusion (GTAO) options
|
||||
*/
|
||||
struct Gtao {
|
||||
uint8_t sampleSliceCount = 4; //!< # of slices. Higher value makes less noise.
|
||||
uint8_t sampleStepsPerSlice = 3; //!< # of steps the radius is divided into for integration. Higher value makes less bias.
|
||||
float thicknessHeuristic = 0.004f; //!< thickness heuristic, should be closed to 0. No effect when useVisibilityBitmasks sets to true.
|
||||
/** # of slices. Higher value makes less noise. */
|
||||
uint8_t sampleSliceCount = 4;
|
||||
/** # of steps the radius is divided into for integration. Higher value makes less bias. */
|
||||
uint8_t sampleStepsPerSlice = 3;
|
||||
/** thickness heuristic, should be closed to 0. No effect when useVisibilityBitmasks sets to true. */
|
||||
float thicknessHeuristic = 0.004f;
|
||||
|
||||
/**
|
||||
* Enables or disables visibility bitmasks mode. Notes that bent normal doesn't work under this mode.
|
||||
* Caution: Changing this option at runtime is very expensive as it may trigger a shader re-compilation.
|
||||
*/
|
||||
bool useVisibilityBitmasks = false;
|
||||
float constThickness = 0.5f; //!< constant thickness value of objects on the screen in world space. Only take effect when useVisibilityBitmasks is set to true.
|
||||
/** constant thickness value of objects on the screen in world space. Only take effect when useVisibilityBitmasks is set to true. */
|
||||
float constThickness = 0.5f;
|
||||
|
||||
/**
|
||||
* Increase thickness with distance to maintain detail on distant surfaces.
|
||||
@@ -457,13 +535,14 @@ struct AmbientOcclusionOptions {
|
||||
|
||||
/**
|
||||
* Options for Multi-Sample Anti-aliasing (MSAA)
|
||||
* @see setMultiSampleAntiAliasingOptions()
|
||||
* @see #setMultiSampleAntiAliasingOptions
|
||||
*/
|
||||
struct MultiSampleAntiAliasingOptions {
|
||||
bool enabled = false; //!< enables or disables msaa
|
||||
/** enables or disables msaa */
|
||||
bool enabled = false;
|
||||
|
||||
/**
|
||||
* sampleCount number of samples to use for multi-sampled anti-aliasing.\n
|
||||
* sampleCount number of samples to use for multi-sampled anti-aliasing.<br>
|
||||
* 0: treated as 1
|
||||
* 1: no anti-aliasing
|
||||
* n: sample count. Effective sample could be different depending on the
|
||||
@@ -483,68 +562,98 @@ struct MultiSampleAntiAliasingOptions {
|
||||
* shaders to be recompiled. These options should be changed or set during initialization.
|
||||
* `filterWidth`, `feedback` and `jitterPattern`, however, can be changed at any time.
|
||||
*
|
||||
* `feedback` of 0.1 effectively accumulates a maximum of 19 samples in steady state.
|
||||
* see "A Survey of Temporal Antialiasing Techniques" by Lei Yang and all for more information.
|
||||
* <p><code>feedback</code> of 0.1 effectively accumulates a maximum of 19 samples in steady state.
|
||||
* see "A Survey of Temporal Antialiasing Techniques" by Lei Yang and all for more information.</p>
|
||||
*
|
||||
* @see setTemporalAntiAliasingOptions()
|
||||
* @see #setTemporalAntiAliasingOptions
|
||||
*/
|
||||
struct TemporalAntiAliasingOptions {
|
||||
float filterWidth = 1.0f; //!< @deprecated has no effect.
|
||||
float feedback = 0.12f; //!< history feedback, between 0 (maximum temporal AA) and 1 (no temporal AA).
|
||||
float lodBias = -1.0f; //!< texturing lod bias (typically -1 or -2)
|
||||
float sharpness = 0.0f; //!< post-TAA sharpen, especially useful when upscaling is true.
|
||||
bool enabled = false; //!< enables or disables temporal anti-aliasing
|
||||
float upscaling = 1.0f; //!< Upscaling factor. Disables Dynamic Resolution. [BETA]
|
||||
/** @deprecated has no effect. */
|
||||
float filterWidth = 1.0f;
|
||||
/** history feedback, between 0 (maximum temporal AA) and 1 (no temporal AA). */
|
||||
float feedback = 0.12f;
|
||||
/** texturing lod bias (typically -1 or -2) */
|
||||
float lodBias = -1.0f;
|
||||
/** post-TAA sharpen, especially useful when upscaling is true. */
|
||||
float sharpness = 0.0f;
|
||||
/** enables or disables temporal anti-aliasing */
|
||||
bool enabled = false;
|
||||
/** Upscaling factor. Disables Dynamic Resolution. [BETA] */
|
||||
float upscaling = 1.0f;
|
||||
|
||||
enum class BoxType : uint8_t {
|
||||
AABB, //!< use an AABB neighborhood
|
||||
AABB_VARIANCE //!< use both AABB and variance
|
||||
/** use an AABB neighborhood */
|
||||
AABB,
|
||||
/** use both AABB and variance */
|
||||
AABB_VARIANCE
|
||||
};
|
||||
|
||||
enum class BoxClipping : uint8_t {
|
||||
ACCURATE, //!< Accurate box clipping
|
||||
CLAMP, //!< clamping
|
||||
NONE //!< no rejections (use for debugging)
|
||||
/** Accurate box clipping */
|
||||
ACCURATE,
|
||||
/** clamping */
|
||||
CLAMP,
|
||||
/** no rejections (use for debugging) */
|
||||
NONE
|
||||
};
|
||||
|
||||
enum class JitterPattern : uint8_t {
|
||||
RGSS_X4, //! 4-samples, rotated grid sampling
|
||||
UNIFORM_HELIX_X4, //! 4-samples, uniform grid in helix sequence
|
||||
HALTON_23_X8, //! 8-samples of halton 2,3
|
||||
HALTON_23_X16, //! 16-samples of halton 2,3
|
||||
HALTON_23_X32 //! 32-samples of halton 2,3
|
||||
/** 4-samples, rotated grid sampling */
|
||||
RGSS_X4,
|
||||
/** 4-samples, uniform grid in helix sequence */
|
||||
UNIFORM_HELIX_X4,
|
||||
/** 8-samples of halton 2,3 */
|
||||
HALTON_23_X8,
|
||||
/** 16-samples of halton 2,3 */
|
||||
HALTON_23_X16,
|
||||
/** 32-samples of halton 2,3 */
|
||||
HALTON_23_X32
|
||||
};
|
||||
|
||||
bool filterHistory = true; //!< whether to filter the history buffer
|
||||
bool filterInput = true; //!< whether to apply the reconstruction filter to the input
|
||||
bool useYCoCg = false; //!< whether to use the YcoCg color-space for history rejection
|
||||
bool hdr = true; //!< set to true for HDR content
|
||||
BoxType boxType = BoxType::AABB; //!< type of color gamut box
|
||||
BoxClipping boxClipping = BoxClipping::ACCURATE; //!< clipping algorithm
|
||||
JitterPattern jitterPattern = JitterPattern::HALTON_23_X16; //! Jitter Pattern
|
||||
float varianceGamma = 1.0f; //! High values increases ghosting artefact, lower values increases jittering, range [0.75, 1.25]
|
||||
/** whether to filter the history buffer */
|
||||
bool filterHistory = true;
|
||||
/** whether to apply the reconstruction filter to the input */
|
||||
bool filterInput = true;
|
||||
/** whether to use the YcoCg color-space for history rejection */
|
||||
bool useYCoCg = false;
|
||||
/** set to true for HDR content */
|
||||
bool hdr = true;
|
||||
/** type of color gamut box */
|
||||
BoxType boxType = BoxType::AABB;
|
||||
/** clipping algorithm */
|
||||
BoxClipping boxClipping = BoxClipping::ACCURATE;
|
||||
/** Jitter Pattern */
|
||||
JitterPattern jitterPattern = JitterPattern::HALTON_23_X16;
|
||||
/** High values increases ghosting artefact, lower values increases jittering, range [0.75, 1.25] */
|
||||
float varianceGamma = 1.0f;
|
||||
|
||||
bool preventFlickering = false; //!< adjust the feedback dynamically to reduce flickering
|
||||
bool historyReprojection = true; //!< whether to apply history reprojection (debug option)
|
||||
/** adjust the feedback dynamically to reduce flickering */
|
||||
bool preventFlickering = false;
|
||||
/** whether to apply history reprojection (debug option) */
|
||||
bool historyReprojection = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Options for Screen-space Reflections.
|
||||
* @see setScreenSpaceReflectionsOptions()
|
||||
* @see #setScreenSpaceReflectionsOptions
|
||||
*/
|
||||
struct ScreenSpaceReflectionsOptions {
|
||||
float thickness = 0.1f; //!< ray thickness, in world units
|
||||
float bias = 0.01f; //!< bias, in world units, to prevent self-intersections
|
||||
float maxDistance = 3.0f; //!< maximum distance, in world units, to raycast
|
||||
float stride = 2.0f; //!< stride, in texels, for samples along the ray.
|
||||
/** ray thickness, in world units */
|
||||
float thickness = 0.1f;
|
||||
/** bias, in world units, to prevent self-intersections */
|
||||
float bias = 0.01f;
|
||||
/** maximum distance, in world units, to raycast */
|
||||
float maxDistance = 3.0f;
|
||||
/** stride, in texels, for samples along the ray. */
|
||||
float stride = 2.0f;
|
||||
bool enabled = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Options for the screen-space guard band.
|
||||
* A guard band can be enabled to avoid some artifacts towards the edge of the screen when
|
||||
* <p>A guard band can be enabled to avoid some artifacts towards the edge of the screen when
|
||||
* using screen-space effects such as SSAO. Enabling the guard band reduces performance slightly.
|
||||
* Currently the guard band can only be enabled or disabled.
|
||||
* Currently the guard band can only be enabled or disabled.</p>
|
||||
*/
|
||||
struct GuardBandOptions {
|
||||
bool enabled = false;
|
||||
@@ -552,44 +661,55 @@ struct GuardBandOptions {
|
||||
|
||||
/**
|
||||
* List of available post-processing anti-aliasing techniques.
|
||||
* @see setAntiAliasing, getAntiAliasing, setSampleCount
|
||||
* @see #setAntiAliasing
|
||||
* @see #getAntiAliasing
|
||||
* @see #setSampleCount
|
||||
*/
|
||||
enum class AntiAliasing : uint8_t {
|
||||
NONE, //!< no anti aliasing performed as part of post-processing
|
||||
FXAA //!< FXAA is a low-quality but very efficient type of anti-aliasing. (default).
|
||||
/** no anti aliasing performed as part of post-processing */
|
||||
NONE,
|
||||
/** FXAA is a low-quality but very efficient type of anti-aliasing. (default). */
|
||||
FXAA
|
||||
};
|
||||
|
||||
/**
|
||||
* List of available post-processing dithering techniques.
|
||||
*/
|
||||
enum class Dithering : uint8_t {
|
||||
NONE, //!< No dithering
|
||||
TEMPORAL //!< Temporal dithering (default)
|
||||
/** No dithering */
|
||||
NONE,
|
||||
/** Temporal dithering (default) */
|
||||
TEMPORAL
|
||||
};
|
||||
|
||||
/**
|
||||
* List of available shadow mapping techniques.
|
||||
* @see setShadowType
|
||||
* @see #setShadowType
|
||||
*/
|
||||
enum class ShadowType : uint8_t {
|
||||
PCF, //!< percentage-closer filtered shadows (default)
|
||||
VSM, //!< variance shadows
|
||||
DPCF, //!< PCF with contact hardening simulation
|
||||
PCSS, //!< PCF with soft shadows and contact hardening
|
||||
PCFd, // for debugging only, don't use.
|
||||
/** percentage-closer filtered shadows (default) */
|
||||
PCF,
|
||||
/** variance shadows */
|
||||
VSM,
|
||||
/** PCF with contact hardening simulation */
|
||||
DPCF,
|
||||
/** PCF with soft shadows and contact hardening */
|
||||
PCSS,
|
||||
// for debugging only, don't use.
|
||||
PCFd,
|
||||
};
|
||||
|
||||
/**
|
||||
* View-level options for VSM Shadowing.
|
||||
* @see setVsmShadowOptions()
|
||||
* @warning This API is still experimental and subject to change.
|
||||
* @see #setVsmShadowOptions
|
||||
* <b>Warning:</b> This API is still experimental and subject to change.
|
||||
*/
|
||||
struct VsmShadowOptions {
|
||||
/**
|
||||
* Sets the number of anisotropic samples to use when sampling a VSM shadow map. If greater
|
||||
* than 0, mipmaps will automatically be generated each frame for all lights.
|
||||
*
|
||||
* The number of anisotropic samples = 2 ^ vsmAnisotropy.
|
||||
* <p>The number of anisotropic samples = 2 ^ vsmAnisotropy.</p>
|
||||
*/
|
||||
uint8_t anisotropy = 0;
|
||||
|
||||
@@ -627,8 +747,8 @@ struct VsmShadowOptions {
|
||||
|
||||
/**
|
||||
* View-level options for DPCF and PCSS Shadowing.
|
||||
* @see setSoftShadowOptions()
|
||||
* @warning This API is still experimental and subject to change.
|
||||
* @see #setSoftShadowOptions
|
||||
* <b>Warning:</b> This API is still experimental and subject to change.
|
||||
*/
|
||||
struct SoftShadowOptions {
|
||||
/**
|
||||
|
||||
576
web/filament-js/filament.d.ts
vendored
576
web/filament-js/filament.d.ts
vendored
@@ -1130,185 +1130,153 @@ export enum View$BlendMode {
|
||||
* by lowering the resolution of a View, or to increase the quality when the
|
||||
* rendering is faster than the target frame rate.
|
||||
*
|
||||
* This structure can be used to specify the minimum scale factor used when
|
||||
* <p>This structure can be used to specify the minimum scale factor used when
|
||||
* lowering the resolution of a View, and the maximum scale factor used when
|
||||
* increasing the resolution for higher quality rendering. The scale factors
|
||||
* can be controlled on each X and Y axis independently. By default, all scale
|
||||
* factors are set to 1.0.
|
||||
* factors are set to 1.0.</p>
|
||||
*
|
||||
* enabled: enable or disables dynamic resolution on a View
|
||||
* <ul>
|
||||
* <li>enabled: enable or disables dynamic resolution on a View</li>
|
||||
*
|
||||
* homogeneousScaling: by default the system scales the major axis first. Set this to true
|
||||
* to force homogeneous scaling.
|
||||
* <li>homogeneousScaling: by default the system scales the major axis first. Set this to true
|
||||
* to force homogeneous scaling.</li>
|
||||
*
|
||||
* minScale: the minimum scale in X and Y this View should use
|
||||
* <li>minScale: the minimum scale in X and Y this View should use</li>
|
||||
*
|
||||
* maxScale: the maximum scale in X and Y this View should use
|
||||
* <li>maxScale: the maximum scale in X and Y this View should use</li>
|
||||
*
|
||||
* quality: upscaling quality.
|
||||
* LOW: 1 bilinear tap, Medium: 4 bilinear taps, High: 9 bilinear taps (tent)
|
||||
* <li>quality: upscaling quality.
|
||||
* LOW: 1 bilinear tap, Medium: 4 bilinear taps, High: 9 bilinear taps (tent)</li>
|
||||
* </ul>
|
||||
*
|
||||
* \note
|
||||
* <p>Note:
|
||||
* Dynamic resolution is only supported on platforms where the time to render
|
||||
* a frame can be measured accurately. On platforms where this is not supported,
|
||||
* Dynamic Resolution can't be enabled unless minScale == maxScale.
|
||||
* Dynamic Resolution can't be enabled unless <code>minScale == maxScale</code>.</p>
|
||||
*
|
||||
* @see Renderer::FrameRateOptions
|
||||
* @see Renderer.FrameRateOptions
|
||||
*
|
||||
*/
|
||||
export interface View$DynamicResolutionOptions {
|
||||
/**
|
||||
* minimum scale factors in x and y
|
||||
*/
|
||||
/** minimum scale factors in x and y */
|
||||
minScale?: float2;
|
||||
/**
|
||||
* maximum scale factors in x and y
|
||||
*/
|
||||
/** maximum scale factors in x and y */
|
||||
maxScale?: float2;
|
||||
/**
|
||||
* sharpness when QualityLevel::MEDIUM or higher is used [0 (disabled), 1 (sharpest)]
|
||||
*/
|
||||
/** sharpness when QualityLevel::MEDIUM or higher is used [0 (disabled), 1 (sharpest)] */
|
||||
sharpness?: number;
|
||||
/**
|
||||
* enable or disable dynamic resolution
|
||||
*/
|
||||
/** enable or disable dynamic resolution */
|
||||
enabled?: boolean;
|
||||
/**
|
||||
* set to true to force homogeneous scaling
|
||||
*/
|
||||
/** set to true to force homogeneous scaling */
|
||||
homogeneousScaling?: boolean;
|
||||
/**
|
||||
* Upscaling quality
|
||||
* LOW: bilinear filtered blit. Fastest, poor quality
|
||||
* MEDIUM: Qualcomm Snapdragon Game Super Resolution (SGSR) 1.0
|
||||
* HIGH: AMD FidelityFX FSR1 w/ mobile optimizations
|
||||
* ULTRA: AMD FidelityFX FSR1
|
||||
* <ul>
|
||||
* <li>LOW: bilinear filtered blit. Fastest, poor quality</li>
|
||||
* <li>MEDIUM: Qualcomm Snapdragon Game Super Resolution (SGSR) 1.0</li>
|
||||
* <li>HIGH: AMD FidelityFX FSR1 w/ mobile optimizations</li>
|
||||
* <li>ULTRA: AMD FidelityFX FSR1</li>
|
||||
* </ul>
|
||||
* FSR1 and SGSR require a well anti-aliased (MSAA or TAA), noise free scene.
|
||||
* Avoid FXAA and dithering.
|
||||
*
|
||||
* The default upscaling quality is set to LOW.
|
||||
* <p>The default upscaling quality is set to LOW.</p>
|
||||
*
|
||||
* caveat: currently, 'quality' is always set to LOW if the View is TRANSLUCENT.
|
||||
* <p>caveat: currently, <code>quality</code> is always set to LOW if the View is TRANSLUCENT.</p>
|
||||
*/
|
||||
quality?: View$QualityLevel;
|
||||
}
|
||||
|
||||
export enum View$BloomOptions$BlendMode {
|
||||
ADD, // Bloom is modulated by the strength parameter and added to the scene
|
||||
INTERPOLATE, // Bloom is interpolated with the scene using the strength parameter
|
||||
ADD, // /** Bloom is modulated by the strength parameter and added to the scene */
|
||||
|
||||
INTERPOLATE, // /** Bloom is interpolated with the scene using the strength parameter */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Options to control the bloom effect
|
||||
*
|
||||
* enabled: Enable or disable the bloom post-processing effect. Disabled by default.
|
||||
* <ul>
|
||||
* <li>enabled: Enable or disable the bloom post-processing effect. Disabled by default.</li>
|
||||
*
|
||||
* levels: Number of successive blurs to achieve the blur effect, the minimum is 3 and the
|
||||
* <li>levels: Number of successive blurs to achieve the blur effect, the minimum is 3 and the
|
||||
* maximum is 12. This value together with resolution influences the spread of the
|
||||
* blur effect. This value can be silently reduced to accommodate the original
|
||||
* image size.
|
||||
* image size.</li>
|
||||
*
|
||||
* resolution: Resolution of bloom's minor axis. The minimum value is 2^levels and the
|
||||
* <li>resolution: Resolution of bloom's minor axis. The minimum value is 2^levels and the
|
||||
* the maximum is lower of the original resolution and 4096. This parameter is
|
||||
* silently clamped to the minimum and maximum.
|
||||
* It is highly recommended that this value be smaller than the target resolution
|
||||
* after dynamic resolution is applied (horizontally and vertically).
|
||||
* after dynamic resolution is applied (horizontally and vertically).</li>
|
||||
*
|
||||
* strength: how much of the bloom is added to the original image. Between 0 and 1.
|
||||
* <li>strength: how much of the bloom is added to the original image. Between 0 and 1.</li>
|
||||
*
|
||||
* blendMode: Whether the bloom effect is purely additive (false) or mixed with the original
|
||||
* image (true).
|
||||
* <li>blendMode: Whether the bloom effect is purely additive (false) or mixed with the original
|
||||
* image (true).</li>
|
||||
*
|
||||
* threshold: When enabled, a threshold at 1.0 is applied on the source image, this is
|
||||
* useful for artistic reasons and is usually needed when a dirt texture is used.
|
||||
* <li>threshold: When enabled, a threshold at 1.0 is applied on the source image, this is
|
||||
* useful for artistic reasons and is usually needed when a dirt texture is used.</li>
|
||||
*
|
||||
* dirt: A dirt/scratch/smudges texture (that can be RGB), which gets added to the
|
||||
* <li>dirt: A dirt/scratch/smudges texture (that can be RGB), which gets added to the
|
||||
* bloom effect. Smudges are visible where bloom occurs. Threshold must be
|
||||
* enabled for the dirt effect to work properly.
|
||||
* enabled for the dirt effect to work properly.</li>
|
||||
*
|
||||
* dirtStrength: Strength of the dirt texture.
|
||||
* <li>dirtStrength: Strength of the dirt texture.</li>
|
||||
* </ul>
|
||||
*/
|
||||
export interface View$BloomOptions {
|
||||
// JavaScript binding for dirt is not yet supported, must use default value.
|
||||
// JavaScript binding for dirtStrength is not yet supported, must use default value.
|
||||
/**
|
||||
* bloom's strength between 0.0 and 1.0
|
||||
*/
|
||||
/** bloom's strength between 0.0 and 1.0 */
|
||||
strength?: number;
|
||||
/**
|
||||
* resolution of vertical axis (2^levels to 2048)
|
||||
*/
|
||||
/** resolution of vertical axis (2^levels to 2048) */
|
||||
resolution?: number;
|
||||
/**
|
||||
* number of blur levels (1 to 11)
|
||||
*/
|
||||
/** number of blur levels (1 to 11) */
|
||||
levels?: number;
|
||||
/**
|
||||
* how the bloom effect is applied
|
||||
*/
|
||||
/** how the bloom effect is applied */
|
||||
blendMode?: View$BloomOptions$BlendMode;
|
||||
/**
|
||||
* whether to threshold the source
|
||||
*/
|
||||
/** whether to threshold the source */
|
||||
threshold?: boolean;
|
||||
/**
|
||||
* enable or disable bloom
|
||||
*/
|
||||
/** enable or disable bloom */
|
||||
enabled?: boolean;
|
||||
/**
|
||||
* limit highlights to this value before bloom [10, +inf]
|
||||
*/
|
||||
/** limit highlights to this value before bloom [10, +inf] */
|
||||
highlight?: number;
|
||||
/**
|
||||
* Bloom quality level.
|
||||
* LOW (default): use a more optimized down-sampling filter, however there can be artifacts
|
||||
* with dynamic resolution, this can be alleviated by using the homogenous mode.
|
||||
* MEDIUM: Good balance between quality and performance.
|
||||
* HIGH: In this mode the bloom resolution is automatically increased to avoid artifacts.
|
||||
* <ul>
|
||||
* <li>LOW (default): use a more optimized down-sampling filter, however there can be artifacts
|
||||
* with dynamic resolution, this can be alleviated by using the homogenous mode.</li>
|
||||
* <li>MEDIUM: Good balance between quality and performance.</li>
|
||||
* <li>HIGH: In this mode the bloom resolution is automatically increased to avoid artifacts.
|
||||
* This mode can be significantly slower on mobile, especially at high resolution.
|
||||
* This mode greatly improves the anamorphic bloom.
|
||||
* This mode greatly improves the anamorphic bloom.</li>
|
||||
* </ul>
|
||||
*/
|
||||
quality?: View$QualityLevel;
|
||||
/**
|
||||
* enable screen-space lens flare
|
||||
*/
|
||||
/** enable screen-space lens flare */
|
||||
lensFlare?: boolean;
|
||||
/**
|
||||
* enable starburst effect on lens flare
|
||||
*/
|
||||
/** enable starburst effect on lens flare */
|
||||
starburst?: boolean;
|
||||
/**
|
||||
* amount of chromatic aberration
|
||||
*/
|
||||
/** amount of chromatic aberration */
|
||||
chromaticAberration?: number;
|
||||
/**
|
||||
* number of flare "ghosts"
|
||||
*/
|
||||
/** number of flare "ghosts" */
|
||||
ghostCount?: number;
|
||||
/**
|
||||
* spacing of the ghost in screen units [0, 1[
|
||||
*/
|
||||
/** spacing of the ghost in screen units [0, 1[ */
|
||||
ghostSpacing?: number;
|
||||
/**
|
||||
* hdr threshold for the ghosts
|
||||
*/
|
||||
/** hdr threshold for the ghosts */
|
||||
ghostThreshold?: number;
|
||||
/**
|
||||
* thickness of halo in vertical screen units, 0 to disable
|
||||
*/
|
||||
/** thickness of halo in vertical screen units, 0 to disable */
|
||||
haloThickness?: number;
|
||||
/**
|
||||
* radius of halo in vertical screen units [0, 0.5]
|
||||
*/
|
||||
/** radius of halo in vertical screen units [0, 0.5] */
|
||||
haloRadius?: number;
|
||||
/**
|
||||
* hdr threshold for the halo
|
||||
*/
|
||||
/** hdr threshold for the halo */
|
||||
haloThreshold?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options to control large-scale fog in the scene. Materials can enable the `linearFog` property,
|
||||
* Options to control large-scale fog in the scene. Materials can enable the <code>linearFog</code> property,
|
||||
* which uses a simplified, linear equation for fog calculation; in this mode, the heightFalloff
|
||||
* is ignored as well as the mipmap selection in IBL or skyColor mode.
|
||||
*/
|
||||
@@ -1322,12 +1290,12 @@ export interface View$FogOptions {
|
||||
* This can be used to exclude the skybox, which is desirable if it already contains clouds or
|
||||
* fog. The default value is +infinity which applies the fog to everything.
|
||||
*
|
||||
* Note: The SkyBox is typically at a distance of 1e19 in world space (depending on the near
|
||||
* plane distance and projection used though).
|
||||
* <p>Note: The SkyBox is typically at a distance of 1e19 in world space (depending on the near
|
||||
* plane distance and projection used though).</p>
|
||||
*/
|
||||
cutOffDistance?: number;
|
||||
/**
|
||||
* fog's maximum opacity between 0 and 1. Ignored in `linearFog` mode.
|
||||
* fog's maximum opacity between 0 and 1. Ignored in <code>linearFog</code> mode.
|
||||
*/
|
||||
maximumOpacity?: number;
|
||||
/**
|
||||
@@ -1339,11 +1307,11 @@ export interface View$FogOptions {
|
||||
* It can be expressed as 1/H, where H is the altitude change in world units [m] that causes a
|
||||
* factor 2.78 (e) change in fog density.
|
||||
*
|
||||
* A falloff of 0 means the fog density is constant everywhere and may result is slightly
|
||||
* faster computations.
|
||||
* <p>A falloff of 0 means the fog density is constant everywhere and may result is slightly
|
||||
* faster computations.</p>
|
||||
*
|
||||
* In `linearFog` mode, only use to compute the slope of the linear equation. Completely
|
||||
* ignored if set to 0.
|
||||
* <p>In <code>linearFog</code> mode, only use to compute the slope of the linear equation. Completely
|
||||
* ignored if set to 0.</p>
|
||||
*/
|
||||
heightFalloff?: number;
|
||||
/**
|
||||
@@ -1353,13 +1321,13 @@ export interface View$FogOptions {
|
||||
* above one are allowed but could create a non energy-conservative fog (this is dependant
|
||||
* on the IBL's intensity as well).
|
||||
*
|
||||
* We assume that our fog has no absorption and therefore all the light it scatters out
|
||||
* <p>We assume that our fog has no absorption and therefore all the light it scatters out
|
||||
* becomes ambient light in-scattering and has lost all directionality, i.e.: scattering is
|
||||
* isotropic. This somewhat simulates Rayleigh scattering.
|
||||
* isotropic. This somewhat simulates Rayleigh scattering.</p>
|
||||
*
|
||||
* This value is used as a tint instead, when fogColorFromIbl is enabled.
|
||||
* <p>This value is used as a tint instead, when fogColorFromIbl is enabled.</p>
|
||||
*
|
||||
* @see fogColorFromIbl
|
||||
* @see #fogColorFromIbl
|
||||
*/
|
||||
color?: float3;
|
||||
/**
|
||||
@@ -1367,20 +1335,20 @@ export interface View$FogOptions {
|
||||
* light is absorbed and out-scattered per unit of distance. Each unit of extinction reduces
|
||||
* the incoming light to 37% of its original value.
|
||||
*
|
||||
* Note: The extinction factor is related to the fog density, it's usually some constant K times
|
||||
* <p>Note: The extinction factor is related to the fog density, it's usually some constant K times
|
||||
* the density at sea level (more specifically at fog height). The constant K depends on
|
||||
* the composition of the fog/atmosphere.
|
||||
* the composition of the fog/atmosphere.</p>
|
||||
*
|
||||
* For historical reason this parameter is called `density`.
|
||||
* <p>For historical reason this parameter is called <code>density</code>.</p>
|
||||
*
|
||||
* In `linearFog` mode this is the slope of the linear equation if heightFalloff is set to 0.
|
||||
* <p>In <code>linearFog</code> mode this is the slope of the linear equation if heightFalloff is set to 0.
|
||||
* Otherwise, heightFalloff affects the slope calculation such that it matches the slope of
|
||||
* the standard equation at the camera height.
|
||||
* the standard equation at the camera height.</p>
|
||||
*/
|
||||
density?: number;
|
||||
/**
|
||||
* Distance in world units [m] from the camera where the Sun in-scattering starts.
|
||||
* Ignored in `linearFog` mode.
|
||||
* Ignored in <code>linearFog</code> mode.
|
||||
*/
|
||||
inScatteringStart?: number;
|
||||
/**
|
||||
@@ -1388,18 +1356,18 @@ export interface View$FogOptions {
|
||||
* is scattered (by the fog) towards the camera.
|
||||
* Size of the Sun in-scattering (>0 to activate). Good values are >> 1 (e.g. ~10 - 100).
|
||||
* Smaller values result is a larger scattering size.
|
||||
* Ignored in `linearFog` mode.
|
||||
* Ignored in <code>linearFog</code> mode.
|
||||
*/
|
||||
inScatteringSize?: number;
|
||||
/**
|
||||
* The fog color will be sampled from the IBL in the view direction and tinted by `color`.
|
||||
* The fog color will be sampled from the IBL in the view direction and tinted by <code>color</code>.
|
||||
* Depending on the scene this can produce very convincing results.
|
||||
*
|
||||
* This simulates a more anisotropic phase-function.
|
||||
* <p>This simulates a more anisotropic phase-function.</p>
|
||||
*
|
||||
* `fogColorFromIbl` is ignored when skyTexture is specified.
|
||||
* <p><code>fogColorFromIbl</code> is ignored when skyTexture is specified.</p>
|
||||
*
|
||||
* @see skyColor
|
||||
* @see #skyColor
|
||||
*/
|
||||
fogColorFromIbl?: boolean;
|
||||
// JavaScript binding for skyColor is not yet supported, must use default value.
|
||||
@@ -1418,65 +1386,30 @@ export enum View$DepthOfFieldOptions$Filter {
|
||||
/**
|
||||
* Options to control Depth of Field (DoF) effect in the scene.
|
||||
*
|
||||
* cocScale can be used to set the depth of field blur independently of the camera
|
||||
* <p>cocScale can be used to set the depth of field blur independently of the camera
|
||||
* aperture, e.g. for artistic reasons. This can be achieved by setting:
|
||||
* cocScale = cameraAperture / desiredDoFAperture
|
||||
* cocScale = cameraAperture / desiredDoFAperture</p>
|
||||
*
|
||||
* @see Camera
|
||||
*/
|
||||
export interface View$DepthOfFieldOptions {
|
||||
/**
|
||||
* circle of confusion scale factor (amount of blur)
|
||||
*/
|
||||
/** circle of confusion scale factor (amount of blur) */
|
||||
cocScale?: number;
|
||||
/**
|
||||
* width/height aspect ratio of the circle of confusion (simulate anamorphic lenses)
|
||||
*/
|
||||
/** width/height aspect ratio of the circle of confusion (simulate anamorphic lenses) */
|
||||
cocAspectRatio?: number;
|
||||
/**
|
||||
* maximum aperture diameter in meters (zero to disable rotation)
|
||||
*/
|
||||
/** maximum aperture diameter in meters (zero to disable rotation) */
|
||||
maxApertureDiameter?: number;
|
||||
/**
|
||||
* enable or disable depth of field effect
|
||||
*/
|
||||
/** enable or disable depth of field effect */
|
||||
enabled?: boolean;
|
||||
/**
|
||||
* filter to use for filling gaps in the kernel
|
||||
*/
|
||||
/** filter to use for filling gaps in the kernel */
|
||||
filter?: View$DepthOfFieldOptions$Filter;
|
||||
/**
|
||||
* perform DoF processing at native resolution
|
||||
*/
|
||||
/** perform DoF processing at native resolution */
|
||||
nativeResolution?: boolean;
|
||||
/**
|
||||
* Number of of rings used by the gather kernels. The number of rings affects quality
|
||||
* and performance. The actual number of sample per pixel is defined
|
||||
* as (ringCount * 2 - 1)^2. Here are a few commonly used values:
|
||||
* 3 rings : 25 ( 5x 5 grid)
|
||||
* 4 rings : 49 ( 7x 7 grid)
|
||||
* 5 rings : 81 ( 9x 9 grid)
|
||||
* 17 rings : 1089 (33x33 grid)
|
||||
*
|
||||
* With a maximum circle-of-confusion of 32, it is never necessary to use more than 17 rings.
|
||||
*
|
||||
* Usually all three settings below are set to the same value, however, it is often
|
||||
* acceptable to use a lower ring count for the "fast tiles", which improves performance.
|
||||
* Fast tiles are regions of the screen where every pixels have a similar
|
||||
* circle-of-confusion radius.
|
||||
*
|
||||
* A value of 0 means default, which is 5 on desktop and 3 on mobile.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/** number of kernel rings for foreground tiles */
|
||||
foregroundRingCount?: number;
|
||||
/**
|
||||
* number of kernel rings for background tiles
|
||||
*/
|
||||
/** number of kernel rings for background tiles */
|
||||
backgroundRingCount?: number;
|
||||
/**
|
||||
* number of kernel rings for fast tiles
|
||||
*/
|
||||
/** number of kernel rings for fast tiles */
|
||||
fastGatherRingCount?: number;
|
||||
/**
|
||||
* maximum circle-of-confusion in pixels for the foreground, must be in [0, 32] range.
|
||||
@@ -1494,49 +1427,42 @@ export interface View$DepthOfFieldOptions {
|
||||
* Options to control the vignetting effect.
|
||||
*/
|
||||
export interface View$VignetteOptions {
|
||||
/**
|
||||
* high values restrict the vignette closer to the corners, between 0 and 1
|
||||
*/
|
||||
/** high values restrict the vignette closer to the corners, between 0 and 1 */
|
||||
midPoint?: number;
|
||||
/**
|
||||
* controls the shape of the vignette, from a rounded rectangle (0.0), to an oval (0.5), to a circle (1.0)
|
||||
*/
|
||||
/** controls the shape of the vignette, from a rounded rectangle (0.0), to an oval (0.5), to a circle (1.0) */
|
||||
roundness?: number;
|
||||
/**
|
||||
* softening amount of the vignette effect, between 0 and 1
|
||||
*/
|
||||
/** softening amount of the vignette effect, between 0 and 1 */
|
||||
feather?: number;
|
||||
/**
|
||||
* color of the vignette effect, alpha is currently ignored
|
||||
*/
|
||||
/** color of the vignette effect, alpha is currently ignored */
|
||||
color?: float4;
|
||||
/**
|
||||
* enables or disables the vignette effect
|
||||
*/
|
||||
/** enables or disables the vignette effect */
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Structure used to set the precision of the color buffer and related quality settings.
|
||||
*
|
||||
* @see setRenderQuality, getRenderQuality
|
||||
* @see #setRenderQuality
|
||||
* @see #getRenderQuality
|
||||
*/
|
||||
export interface View$RenderQuality {
|
||||
/**
|
||||
* Sets the quality of the HDR color buffer.
|
||||
*
|
||||
* A quality of HIGH or ULTRA means using an RGB16F or RGBA16F color buffer. This means
|
||||
* <p>A quality of HIGH or ULTRA means using an RGB16F or RGBA16F color buffer. This means
|
||||
* colors in the LDR range (0..1) have a 10 bit precision. A quality of LOW or MEDIUM means
|
||||
* using an R11G11B10F opaque color buffer or an RGBA16F transparent color buffer. With
|
||||
* R11G11B10F colors in the LDR range have a precision of either 6 bits (red and green
|
||||
* channels) or 5 bits (blue channel).
|
||||
* channels) or 5 bits (blue channel).</p>
|
||||
*/
|
||||
hdrColorBuffer?: View$QualityLevel;
|
||||
}
|
||||
|
||||
export enum View$AmbientOcclusionOptions$AmbientOcclusionType {
|
||||
SAO, // use Scalable Ambient Occlusion
|
||||
GTAO, // use Ground Truth-Based Ambient Occlusion
|
||||
SAO, // /** use Scalable Ambient Occlusion */
|
||||
|
||||
GTAO, // /** use Ground Truth-Based Ambient Occlusion */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1544,45 +1470,25 @@ export enum View$AmbientOcclusionOptions$AmbientOcclusionType {
|
||||
* Ambient shadows from dominant light
|
||||
*/
|
||||
export interface View$AmbientOcclusionOptions$Ssct {
|
||||
/**
|
||||
* full cone angle in radian, between 0 and pi/2
|
||||
*/
|
||||
/** full cone angle in radian, between 0 and pi/2 */
|
||||
lightConeRad?: number;
|
||||
/**
|
||||
* how far shadows can be cast
|
||||
*/
|
||||
/** how far shadows can be cast */
|
||||
shadowDistance?: number;
|
||||
/**
|
||||
* max distance for contact
|
||||
*/
|
||||
/** max distance for contact */
|
||||
contactDistanceMax?: number;
|
||||
/**
|
||||
* intensity
|
||||
*/
|
||||
/** intensity */
|
||||
intensity?: number;
|
||||
/**
|
||||
* light direction
|
||||
*/
|
||||
/** light direction */
|
||||
lightDirection?: float3;
|
||||
/**
|
||||
* depth bias in world units (mitigate self shadowing)
|
||||
*/
|
||||
/** depth bias in world units (mitigate self shadowing) */
|
||||
depthBias?: number;
|
||||
/**
|
||||
* depth slope bias (mitigate self shadowing)
|
||||
*/
|
||||
/** depth slope bias (mitigate self shadowing) */
|
||||
depthSlopeBias?: number;
|
||||
/**
|
||||
* tracing sample count, between 1 and 255
|
||||
*/
|
||||
/** tracing sample count, between 1 and 255 */
|
||||
sampleCount?: number;
|
||||
/**
|
||||
* # of rays to trace, between 1 and 255
|
||||
*/
|
||||
/** # of rays to trace, between 1 and 255 */
|
||||
rayCount?: number;
|
||||
/**
|
||||
* enables or disables SSCT
|
||||
*/
|
||||
/** enables or disables SSCT */
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
@@ -1590,26 +1496,18 @@ export interface View$AmbientOcclusionOptions$Ssct {
|
||||
* Ground Truth-base Ambient Occlusion (GTAO) options
|
||||
*/
|
||||
export interface View$AmbientOcclusionOptions$Gtao {
|
||||
/**
|
||||
* # of slices. Higher value makes less noise.
|
||||
*/
|
||||
/** # of slices. Higher value makes less noise. */
|
||||
sampleSliceCount?: number;
|
||||
/**
|
||||
* # of steps the radius is divided into for integration. Higher value makes less bias.
|
||||
*/
|
||||
/** # of steps the radius is divided into for integration. Higher value makes less bias. */
|
||||
sampleStepsPerSlice?: number;
|
||||
/**
|
||||
* thickness heuristic, should be closed to 0. No effect when useVisibilityBitmasks sets to true.
|
||||
*/
|
||||
/** thickness heuristic, should be closed to 0. No effect when useVisibilityBitmasks sets to true. */
|
||||
thicknessHeuristic?: number;
|
||||
/**
|
||||
* Enables or disables visibility bitmasks mode. Notes that bent normal doesn't work under this mode.
|
||||
* Caution: Changing this option at runtime is very expensive as it may trigger a shader re-compilation.
|
||||
*/
|
||||
useVisibilityBitmasks?: boolean;
|
||||
/**
|
||||
* constant thickness value of objects on the screen in world space. Only take effect when useVisibilityBitmasks is set to true.
|
||||
*/
|
||||
/** constant thickness value of objects on the screen in world space. Only take effect when useVisibilityBitmasks is set to true. */
|
||||
constThickness?: number;
|
||||
/**
|
||||
* Increase thickness with distance to maintain detail on distant surfaces.
|
||||
@@ -1620,61 +1518,37 @@ export interface View$AmbientOcclusionOptions$Gtao {
|
||||
|
||||
/**
|
||||
* Options for screen space Ambient Occlusion (SSAO) and Screen Space Cone Tracing (SSCT)
|
||||
* @see setAmbientOcclusionOptions()
|
||||
* @see #setAmbientOcclusionOptions
|
||||
*/
|
||||
export interface View$AmbientOcclusionOptions {
|
||||
/**
|
||||
* Type of ambient occlusion algorithm.
|
||||
*/
|
||||
/** Type of ambient occlusion algorithm. */
|
||||
aoType?: View$AmbientOcclusionOptions$AmbientOcclusionType;
|
||||
/**
|
||||
* Ambient Occlusion radius in meters, between 0 and ~10.
|
||||
*/
|
||||
/** Ambient Occlusion radius in meters, between 0 and ~10. */
|
||||
radius?: number;
|
||||
/**
|
||||
* Controls ambient occlusion's contrast. Must be positive.
|
||||
*/
|
||||
/** Controls ambient occlusion's contrast. Must be positive. */
|
||||
power?: number;
|
||||
/**
|
||||
* Self-occlusion bias in meters. Use to avoid self-occlusion.
|
||||
* Between 0 and a few mm. No effect when aoType set to GTAO
|
||||
*/
|
||||
bias?: number;
|
||||
/**
|
||||
* How each dimension of the AO buffer is scaled. Must be either 0.5 or 1.0.
|
||||
*/
|
||||
/** How each dimension of the AO buffer is scaled. Must be either 0.5 or 1.0. */
|
||||
resolution?: number;
|
||||
/**
|
||||
* Strength of the Ambient Occlusion effect.
|
||||
*/
|
||||
/** Strength of the Ambient Occlusion effect. */
|
||||
intensity?: number;
|
||||
/**
|
||||
* depth distance that constitute an edge for filtering
|
||||
*/
|
||||
/** depth distance that constitute an edge for filtering */
|
||||
bilateralThreshold?: number;
|
||||
/**
|
||||
* affects # of samples used for AO and params for filtering
|
||||
*/
|
||||
/** affects # of samples used for AO and params for filtering */
|
||||
quality?: View$QualityLevel;
|
||||
/**
|
||||
* affects AO smoothness. Recommend setting to HIGH when aoType set to GTAO.
|
||||
*/
|
||||
/** affects AO smoothness. Recommend setting to HIGH when aoType set to GTAO. */
|
||||
lowPassFilter?: View$QualityLevel;
|
||||
/**
|
||||
* affects AO buffer upsampling quality
|
||||
*/
|
||||
/** affects AO buffer upsampling quality */
|
||||
upsampling?: View$QualityLevel;
|
||||
/**
|
||||
* enables or disables screen-space ambient occlusion
|
||||
*/
|
||||
/** enables or disables screen-space ambient occlusion */
|
||||
enabled?: boolean;
|
||||
/**
|
||||
* enables bent normals computation from AO, and specular AO
|
||||
*/
|
||||
/** enables bent normals computation from AO, and specular AO */
|
||||
bentNormals?: boolean;
|
||||
/**
|
||||
* min angle in radian to consider. No effect when aoType set to GTAO.
|
||||
*/
|
||||
/** min angle in radian to consider. No effect when aoType set to GTAO. */
|
||||
minHorizonAngleRad?: number;
|
||||
// JavaScript binding for ssct is not yet supported, must use default value.
|
||||
// JavaScript binding for gtao is not yet supported, must use default value.
|
||||
@@ -1682,15 +1556,13 @@ export interface View$AmbientOcclusionOptions {
|
||||
|
||||
/**
|
||||
* Options for Multi-Sample Anti-aliasing (MSAA)
|
||||
* @see setMultiSampleAntiAliasingOptions()
|
||||
* @see #setMultiSampleAntiAliasingOptions
|
||||
*/
|
||||
export interface View$MultiSampleAntiAliasingOptions {
|
||||
/**
|
||||
* enables or disables msaa
|
||||
*/
|
||||
/** enables or disables msaa */
|
||||
enabled?: boolean;
|
||||
/**
|
||||
* sampleCount number of samples to use for multi-sampled anti-aliasing.\n
|
||||
* sampleCount number of samples to use for multi-sampled anti-aliasing.<br>
|
||||
* 0: treated as 1
|
||||
* 1: no anti-aliasing
|
||||
* n: sample count. Effective sample could be different depending on the
|
||||
@@ -1704,22 +1576,32 @@ export interface View$MultiSampleAntiAliasingOptions {
|
||||
}
|
||||
|
||||
export enum View$TemporalAntiAliasingOptions$BoxType {
|
||||
AABB, // use an AABB neighborhood
|
||||
AABB_VARIANCE, // use both AABB and variance
|
||||
AABB, // /** use an AABB neighborhood */
|
||||
|
||||
AABB_VARIANCE, // /** use both AABB and variance */
|
||||
|
||||
}
|
||||
|
||||
export enum View$TemporalAntiAliasingOptions$BoxClipping {
|
||||
ACCURATE, // Accurate box clipping
|
||||
CLAMP, // clamping
|
||||
NONE, // no rejections (use for debugging)
|
||||
ACCURATE, // /** Accurate box clipping */
|
||||
|
||||
CLAMP, // /** clamping */
|
||||
|
||||
NONE, // /** no rejections (use for debugging) */
|
||||
|
||||
}
|
||||
|
||||
export enum View$TemporalAntiAliasingOptions$JitterPattern {
|
||||
RGSS_X4,
|
||||
UNIFORM_HELIX_X4,
|
||||
HALTON_23_X8,
|
||||
HALTON_23_X16,
|
||||
HALTON_23_X32,
|
||||
RGSS_X4, // /** 4-samples, rotated grid sampling */
|
||||
|
||||
UNIFORM_HELIX_X4, // /** 4-samples, uniform grid in helix sequence */
|
||||
|
||||
HALTON_23_X8, // /** 8-samples of halton 2,3 */
|
||||
|
||||
HALTON_23_X16, // /** 16-samples of halton 2,3 */
|
||||
|
||||
HALTON_23_X32, // /** 32-samples of halton 2,3 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1728,101 +1610,67 @@ export enum View$TemporalAntiAliasingOptions$JitterPattern {
|
||||
* shaders to be recompiled. These options should be changed or set during initialization.
|
||||
* `filterWidth`, `feedback` and `jitterPattern`, however, can be changed at any time.
|
||||
*
|
||||
* `feedback` of 0.1 effectively accumulates a maximum of 19 samples in steady state.
|
||||
* see "A Survey of Temporal Antialiasing Techniques" by Lei Yang and all for more information.
|
||||
* <p><code>feedback</code> of 0.1 effectively accumulates a maximum of 19 samples in steady state.
|
||||
* see "A Survey of Temporal Antialiasing Techniques" by Lei Yang and all for more information.</p>
|
||||
*
|
||||
* @see setTemporalAntiAliasingOptions()
|
||||
* @see #setTemporalAntiAliasingOptions
|
||||
*/
|
||||
export interface View$TemporalAntiAliasingOptions {
|
||||
/**
|
||||
* @deprecated has no effect.
|
||||
*/
|
||||
/** @deprecated has no effect. */
|
||||
filterWidth?: number;
|
||||
/**
|
||||
* history feedback, between 0 (maximum temporal AA) and 1 (no temporal AA).
|
||||
*/
|
||||
/** history feedback, between 0 (maximum temporal AA) and 1 (no temporal AA). */
|
||||
feedback?: number;
|
||||
/**
|
||||
* texturing lod bias (typically -1 or -2)
|
||||
*/
|
||||
/** texturing lod bias (typically -1 or -2) */
|
||||
lodBias?: number;
|
||||
/**
|
||||
* post-TAA sharpen, especially useful when upscaling is true.
|
||||
*/
|
||||
/** post-TAA sharpen, especially useful when upscaling is true. */
|
||||
sharpness?: number;
|
||||
/**
|
||||
* enables or disables temporal anti-aliasing
|
||||
*/
|
||||
/** enables or disables temporal anti-aliasing */
|
||||
enabled?: boolean;
|
||||
/**
|
||||
* Upscaling factor. Disables Dynamic Resolution. [BETA]
|
||||
*/
|
||||
/** Upscaling factor. Disables Dynamic Resolution. [BETA] */
|
||||
upscaling?: number;
|
||||
/**
|
||||
* whether to filter the history buffer
|
||||
*/
|
||||
/** whether to filter the history buffer */
|
||||
filterHistory?: boolean;
|
||||
/**
|
||||
* whether to apply the reconstruction filter to the input
|
||||
*/
|
||||
/** whether to apply the reconstruction filter to the input */
|
||||
filterInput?: boolean;
|
||||
/**
|
||||
* whether to use the YcoCg color-space for history rejection
|
||||
*/
|
||||
/** whether to use the YcoCg color-space for history rejection */
|
||||
useYCoCg?: boolean;
|
||||
/**
|
||||
* set to true for HDR content
|
||||
*/
|
||||
/** set to true for HDR content */
|
||||
hdr?: boolean;
|
||||
/**
|
||||
* type of color gamut box
|
||||
*/
|
||||
/** type of color gamut box */
|
||||
boxType?: View$TemporalAntiAliasingOptions$BoxType;
|
||||
/**
|
||||
* clipping algorithm
|
||||
*/
|
||||
/** clipping algorithm */
|
||||
boxClipping?: View$TemporalAntiAliasingOptions$BoxClipping;
|
||||
/** Jitter Pattern */
|
||||
jitterPattern?: View$TemporalAntiAliasingOptions$JitterPattern;
|
||||
/** High values increases ghosting artefact, lower values increases jittering, range [0.75, 1.25] */
|
||||
varianceGamma?: number;
|
||||
/**
|
||||
* adjust the feedback dynamically to reduce flickering
|
||||
*/
|
||||
/** adjust the feedback dynamically to reduce flickering */
|
||||
preventFlickering?: boolean;
|
||||
/**
|
||||
* whether to apply history reprojection (debug option)
|
||||
*/
|
||||
/** whether to apply history reprojection (debug option) */
|
||||
historyReprojection?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for Screen-space Reflections.
|
||||
* @see setScreenSpaceReflectionsOptions()
|
||||
* @see #setScreenSpaceReflectionsOptions
|
||||
*/
|
||||
export interface View$ScreenSpaceReflectionsOptions {
|
||||
/**
|
||||
* ray thickness, in world units
|
||||
*/
|
||||
/** ray thickness, in world units */
|
||||
thickness?: number;
|
||||
/**
|
||||
* bias, in world units, to prevent self-intersections
|
||||
*/
|
||||
/** bias, in world units, to prevent self-intersections */
|
||||
bias?: number;
|
||||
/**
|
||||
* maximum distance, in world units, to raycast
|
||||
*/
|
||||
/** maximum distance, in world units, to raycast */
|
||||
maxDistance?: number;
|
||||
/**
|
||||
* stride, in texels, for samples along the ray.
|
||||
*/
|
||||
/** stride, in texels, for samples along the ray. */
|
||||
stride?: number;
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for the screen-space guard band.
|
||||
* A guard band can be enabled to avoid some artifacts towards the edge of the screen when
|
||||
* <p>A guard band can be enabled to avoid some artifacts towards the edge of the screen when
|
||||
* using screen-space effects such as SSAO. Enabling the guard band reduces performance slightly.
|
||||
* Currently the guard band can only be enabled or disabled.
|
||||
* Currently the guard band can only be enabled or disabled.</p>
|
||||
*/
|
||||
export interface View$GuardBandOptions {
|
||||
enabled?: boolean;
|
||||
@@ -1830,44 +1678,54 @@ export interface View$GuardBandOptions {
|
||||
|
||||
/**
|
||||
* List of available post-processing anti-aliasing techniques.
|
||||
* @see setAntiAliasing, getAntiAliasing, setSampleCount
|
||||
* @see #setAntiAliasing
|
||||
* @see #getAntiAliasing
|
||||
* @see #setSampleCount
|
||||
*/
|
||||
export enum View$AntiAliasing {
|
||||
NONE, // no anti aliasing performed as part of post-processing
|
||||
FXAA, // FXAA is a low-quality but very efficient type of anti-aliasing. (default).
|
||||
NONE, // /** no anti aliasing performed as part of post-processing */
|
||||
|
||||
FXAA, // /** FXAA is a low-quality but very efficient type of anti-aliasing. (default). */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* List of available post-processing dithering techniques.
|
||||
*/
|
||||
export enum View$Dithering {
|
||||
NONE, // No dithering
|
||||
TEMPORAL, // Temporal dithering (default)
|
||||
NONE, // /** No dithering */
|
||||
|
||||
TEMPORAL, // /** Temporal dithering (default) */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* List of available shadow mapping techniques.
|
||||
* @see setShadowType
|
||||
* @see #setShadowType
|
||||
*/
|
||||
export enum View$ShadowType {
|
||||
PCF, // percentage-closer filtered shadows (default)
|
||||
VSM, // variance shadows
|
||||
DPCF, // PCF with contact hardening simulation
|
||||
PCSS, // PCF with soft shadows and contact hardening
|
||||
PCF, // /** percentage-closer filtered shadows (default) */
|
||||
|
||||
VSM, // /** variance shadows */
|
||||
|
||||
DPCF, // /** PCF with contact hardening simulation */
|
||||
|
||||
PCSS, // /** PCF with soft shadows and contact hardening */
|
||||
|
||||
PCFd,
|
||||
}
|
||||
|
||||
/**
|
||||
* View-level options for VSM Shadowing.
|
||||
* @see setVsmShadowOptions()
|
||||
* @warning This API is still experimental and subject to change.
|
||||
* @see #setVsmShadowOptions
|
||||
* <b>Warning:</b> This API is still experimental and subject to change.
|
||||
*/
|
||||
export interface View$VsmShadowOptions {
|
||||
/**
|
||||
* Sets the number of anisotropic samples to use when sampling a VSM shadow map. If greater
|
||||
* than 0, mipmaps will automatically be generated each frame for all lights.
|
||||
*
|
||||
* The number of anisotropic samples = 2 ^ vsmAnisotropy.
|
||||
* <p>The number of anisotropic samples = 2 ^ vsmAnisotropy.</p>
|
||||
*/
|
||||
anisotropy?: number;
|
||||
/**
|
||||
@@ -1900,8 +1758,8 @@ export interface View$VsmShadowOptions {
|
||||
|
||||
/**
|
||||
* View-level options for DPCF and PCSS Shadowing.
|
||||
* @see setSoftShadowOptions()
|
||||
* @warning This API is still experimental and subject to change.
|
||||
* @see #setSoftShadowOptions
|
||||
* <b>Warning:</b> This API is still experimental and subject to change.
|
||||
*/
|
||||
export interface View$SoftShadowOptions {
|
||||
/**
|
||||
|
||||
@@ -250,6 +250,7 @@ DecodedImage decodeImage(BufferDescriptor encoded_data, int requested_ncomp) {
|
||||
|
||||
EMSCRIPTEN_BINDINGS(jsbindings) {
|
||||
|
||||
|
||||
// MATH TYPES
|
||||
// ----------
|
||||
// Individual JavaScript objects for math types would be too heavy, so instead we simply accept
|
||||
@@ -404,6 +405,8 @@ class_<Engine>("Engine")
|
||||
|
||||
.function("getActiveFeatureLevel", &Engine::getActiveFeatureLevel)
|
||||
|
||||
.function("getBackend", &Engine::getBackend)
|
||||
|
||||
.class_function("getMaxStereoscopicEyes", &Engine::getMaxStereoscopicEyes)
|
||||
|
||||
.function("_execute", EMBIND_LAMBDA(void, (Engine* engine), {
|
||||
@@ -678,6 +681,13 @@ class_<View>("View")
|
||||
.function("_setTemporalAntiAliasingOptions", &View::setTemporalAntiAliasingOptions)
|
||||
.function("_setScreenSpaceReflectionsOptions", &View::setScreenSpaceReflectionsOptions)
|
||||
.function("_setBloomOptions", &View::setBloomOptions)
|
||||
.function("setShadowingEnabled", &View::setShadowingEnabled)
|
||||
.function("setFrontFaceWindingInverted", &View::setFrontFaceWindingInverted)
|
||||
.function("isFrontFaceWindingInverted", &View::isFrontFaceWindingInverted)
|
||||
.function("setDynamicLightingOptions", &View::setDynamicLightingOptions)
|
||||
.function("setRenderQuality", &View::setRenderQuality)
|
||||
.function("setDynamicResolutionOptions", &View::setDynamicResolutionOptions)
|
||||
.function("getDynamicResolutionOptions", &View::getDynamicResolutionOptions)
|
||||
.function("_setFogOptions", &View::setFogOptions)
|
||||
.function("_setVignetteOptions", &View::setVignetteOptions)
|
||||
.function("_setGuardBandOptions", &View::setGuardBandOptions)
|
||||
@@ -777,6 +787,8 @@ class_<Camera>("Camera")
|
||||
}), allow_raw_pointers())
|
||||
|
||||
.function("getScaling", &Camera::getScaling)
|
||||
.function("setShift", &Camera::setShift)
|
||||
.function("getShift", &Camera::getShift)
|
||||
|
||||
.function("getNear", &Camera::getNear)
|
||||
.function("getCullingFar", &Camera::getCullingFar)
|
||||
@@ -937,7 +949,9 @@ class_<RenderTarget>("RenderTarget")
|
||||
})
|
||||
.function("getMipLevel", &RenderTarget::getMipLevel)
|
||||
.function("getFace", &RenderTarget::getFace)
|
||||
.function("getLayer", &RenderTarget::getLayer);
|
||||
.function("getLayer", &RenderTarget::getLayer)
|
||||
.function("getTexture", &RenderTarget::getTexture, allow_raw_pointers())
|
||||
.function("getSupportedColorAttachmentsCount", &RenderTarget::getSupportedColorAttachmentsCount);
|
||||
|
||||
class_<RenderableBuilder>("RenderableManager$Builder")
|
||||
.BUILDER_FUNCTION("geometry", RenderableBuilder, (RenderableBuilder* builder,
|
||||
@@ -1073,6 +1087,7 @@ class_<RenderableManager>("RenderableManager")
|
||||
.function("getChannel", &RenderableManager::getChannel)
|
||||
.function("setCastShadows", &RenderableManager::setCastShadows)
|
||||
.function("setReceiveShadows", &RenderableManager::setReceiveShadows)
|
||||
.function("setScreenSpaceContactShadows", &RenderableManager::setScreenSpaceContactShadows)
|
||||
.function("isShadowCaster", &RenderableManager::isShadowCaster)
|
||||
.function("isShadowReceiver", &RenderableManager::isShadowReceiver)
|
||||
.function("setLightChannel", &RenderableManager::setLightChannel)
|
||||
@@ -1598,6 +1613,9 @@ class_<IblBuilder>("IndirectLight$Builder")
|
||||
class_<Skybox>("Skybox")
|
||||
.class_function("Builder", (SkyBuilder (*)()) [] { return SkyBuilder(); })
|
||||
.function("setColor", &Skybox::setColor)
|
||||
.function("setLayerMask", &Skybox::setLayerMask)
|
||||
.function("getLayerMask", &Skybox::getLayerMask)
|
||||
.function("getIntensity", &Skybox::getIntensity)
|
||||
.function("getTexture", EMBIND_LAMBDA(Texture*, (Skybox* skybox), {
|
||||
return (Texture*) skybox->getTexture(); // cast away const to appease embind
|
||||
}), allow_raw_pointers());
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
|
||||
#include <ktxreader/Ktx2Reader.h>
|
||||
|
||||
#include <backend/DriverEnums.h>
|
||||
|
||||
#include <emscripten.h>
|
||||
#include <emscripten/bind.h>
|
||||
|
||||
@@ -162,7 +164,10 @@ enum_<Frustum::Plane>("Frustum$Plane")
|
||||
enum_<Texture::Sampler>("Texture$Sampler") // aka backend::SamplerType
|
||||
.value("SAMPLER_2D", Texture::Sampler::SAMPLER_2D)
|
||||
.value("SAMPLER_CUBEMAP", Texture::Sampler::SAMPLER_CUBEMAP)
|
||||
.value("SAMPLER_EXTERNAL", Texture::Sampler::SAMPLER_EXTERNAL);
|
||||
.value("SAMPLER_EXTERNAL", Texture::Sampler::SAMPLER_EXTERNAL)
|
||||
.value("SAMPLER_2D_ARRAY", Texture::Sampler::SAMPLER_2D_ARRAY)
|
||||
.value("SAMPLER_3D", Texture::Sampler::SAMPLER_3D)
|
||||
.value("SAMPLER_CUBEMAP_ARRAY", Texture::Sampler::SAMPLER_CUBEMAP_ARRAY);
|
||||
|
||||
enum_<Texture::InternalFormat>("Texture$InternalFormat") // aka backend::TextureFormat
|
||||
.value("R8", Texture::InternalFormat::R8)
|
||||
@@ -276,7 +281,9 @@ enum_<Texture::Usage>("Texture$Usage") // aka backend::TextureUsage
|
||||
.value("SAMPLEABLE", Texture::Usage::SAMPLEABLE)
|
||||
.value("BLIT_SRC", Texture::Usage::BLIT_SRC)
|
||||
.value("BLIT_DST", Texture::Usage::BLIT_DST)
|
||||
.value("SUBPASS_INPUT", Texture::Usage::SUBPASS_INPUT);
|
||||
.value("SUBPASS_INPUT", Texture::Usage::SUBPASS_INPUT)
|
||||
.value("PROTECTED", Texture::Usage::PROTECTED)
|
||||
.value("GEN_MIPMAPPABLE", Texture::Usage::GEN_MIPMAPPABLE);
|
||||
|
||||
enum_<Texture::CubemapFace>("Texture$CubemapFace") // aka backend::TextureCubemapFace
|
||||
.value("POSITIVE_X", Texture::CubemapFace::POSITIVE_X)
|
||||
@@ -411,7 +418,8 @@ enum_<filament::TransparencyMode>("TransparencyMode")
|
||||
|
||||
enum_<backend::FeatureLevel>("FeatureLevel")
|
||||
.value("FEATURE_LEVEL_1", backend::FeatureLevel::FEATURE_LEVEL_1)
|
||||
.value("FEATURE_LEVEL_2", backend::FeatureLevel::FEATURE_LEVEL_2);
|
||||
.value("FEATURE_LEVEL_2", backend::FeatureLevel::FEATURE_LEVEL_2)
|
||||
.value("FEATURE_LEVEL_3", backend::FeatureLevel::FEATURE_LEVEL_3);
|
||||
|
||||
enum_<backend::StencilOperation>("StencilOperation")
|
||||
.value("KEEP", backend::StencilOperation::KEEP)
|
||||
@@ -439,4 +447,11 @@ enum_<ktxreader::Ktx2Reader::Result>("Ktx2Reader$Result")
|
||||
.value("FORMAT_UNSUPPORTED", ktxreader::Ktx2Reader::Result::FORMAT_UNSUPPORTED)
|
||||
.value("FORMAT_ALREADY_REQUESTED", ktxreader::Ktx2Reader::Result::FORMAT_ALREADY_REQUESTED);
|
||||
|
||||
enum_<backend::Backend>("Backend")
|
||||
.value("DEFAULT", backend::Backend::DEFAULT)
|
||||
.value("OPENGL", backend::Backend::OPENGL)
|
||||
.value("VULKAN", backend::Backend::VULKAN)
|
||||
.value("METAL", backend::Backend::METAL)
|
||||
.value("NOOP", backend::Backend::NOOP);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user