Implement missing getters in RenderableManager (#9673)
FIXES=[479883232]
This commit is contained in:
@@ -366,6 +366,13 @@ Java_com_google_android_filament_RenderableManager_nSetPriority(JNIEnv*, jclass,
|
||||
rm->setPriority((RenderableManager::Instance) i, (uint8_t) priority);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT jint JNICALL
|
||||
Java_com_google_android_filament_RenderableManager_nGetPriority(JNIEnv*, jclass,
|
||||
jlong nativeRenderableManager, jint i) {
|
||||
RenderableManager *rm = (RenderableManager *) nativeRenderableManager;
|
||||
return (jint) rm->getPriority((RenderableManager::Instance) i);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_RenderableManager_nSetChannel(JNIEnv*, jclass,
|
||||
jlong nativeRenderableManager, jint i, jint channel) {
|
||||
@@ -373,6 +380,13 @@ Java_com_google_android_filament_RenderableManager_nSetChannel(JNIEnv*, jclass,
|
||||
rm->setChannel((RenderableManager::Instance) i, (uint8_t) channel);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT jint JNICALL
|
||||
Java_com_google_android_filament_RenderableManager_nGetChannel(JNIEnv*, jclass,
|
||||
jlong nativeRenderableManager, jint i) {
|
||||
RenderableManager *rm = (RenderableManager *) nativeRenderableManager;
|
||||
return (jint) rm->getChannel((RenderableManager::Instance) i);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_RenderableManager_nSetCulling(JNIEnv*, jclass,
|
||||
jlong nativeRenderableManager, jint i, jboolean enabled) {
|
||||
@@ -380,6 +394,13 @@ Java_com_google_android_filament_RenderableManager_nSetCulling(JNIEnv*, jclass,
|
||||
rm->setCulling((RenderableManager::Instance) i, enabled);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT jboolean JNICALL
|
||||
Java_com_google_android_filament_RenderableManager_nIsCullingEnabled(JNIEnv*, jclass,
|
||||
jlong nativeRenderableManager, jint i) {
|
||||
RenderableManager *rm = (RenderableManager *) nativeRenderableManager;
|
||||
return (jboolean) rm->isCullingEnabled((RenderableManager::Instance) i);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_RenderableManager_nSetFogEnabled(JNIEnv*, jclass,
|
||||
jlong nativeRenderableManager, jint i, jboolean enabled) {
|
||||
@@ -429,6 +450,13 @@ Java_com_google_android_filament_RenderableManager_nIsShadowReceiver(JNIEnv*, jc
|
||||
return (jboolean) rm->isShadowReceiver((RenderableManager::Instance) i);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT jboolean JNICALL
|
||||
Java_com_google_android_filament_RenderableManager_nIsScreenSpaceContactShadowsEnabled(JNIEnv*, jclass,
|
||||
jlong nativeRenderableManager, jint i) {
|
||||
RenderableManager *rm = (RenderableManager *) nativeRenderableManager;
|
||||
return (jboolean) rm->isScreenSpaceContactShadowsEnabled((RenderableManager::Instance) i);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_RenderableManager_nGetAxisAlignedBoundingBox(JNIEnv* env,
|
||||
jclass, jlong nativeRenderableManager, jint i, jfloatArray center_,
|
||||
@@ -500,6 +528,13 @@ Java_com_google_android_filament_RenderableManager_nSetBlendOrderAt(JNIEnv*, jcl
|
||||
(uint16_t) blendOrder);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT jint JNICALL
|
||||
Java_com_google_android_filament_RenderableManager_nGetBlendOrderAt(JNIEnv*, jclass,
|
||||
jlong nativeRenderableManager, jint i, jint primitiveIndex) {
|
||||
RenderableManager *rm = (RenderableManager *) nativeRenderableManager;
|
||||
return (jint) rm->getBlendOrderAt((RenderableManager::Instance) i, (size_t) primitiveIndex);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_RenderableManager_nSetGlobalBlendOrderEnabledAt(JNIEnv*, jclass,
|
||||
jlong nativeRenderableManager, jint i, jint primitiveIndex, jboolean enabled) {
|
||||
@@ -508,6 +543,13 @@ Java_com_google_android_filament_RenderableManager_nSetGlobalBlendOrderEnabledAt
|
||||
(bool) enabled);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT jboolean JNICALL
|
||||
Java_com_google_android_filament_RenderableManager_nIsGlobalBlendOrderEnabledAt(JNIEnv*, jclass,
|
||||
jlong nativeRenderableManager, jint i, jint primitiveIndex) {
|
||||
RenderableManager *rm = (RenderableManager *) nativeRenderableManager;
|
||||
return (jboolean) rm->isGlobalBlendOrderEnabledAt((RenderableManager::Instance) i, (size_t) primitiveIndex);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT jint JNICALL
|
||||
Java_com_google_android_filament_RenderableManager_nGetEnabledAttributesAt(JNIEnv*, jclass,
|
||||
jlong nativeRenderableManager, jint i, jint primitiveIndex) {
|
||||
|
||||
@@ -346,8 +346,8 @@ public class RenderableManager {
|
||||
*
|
||||
* @return Builder reference for chaining calls.
|
||||
*
|
||||
* @see Builder::blendOrder()
|
||||
* @see Builder::priority()
|
||||
* @see Builder#blendOrder()
|
||||
* @see Builder#priority()
|
||||
* @see RenderableManager::setBlendOrderAt()
|
||||
*/
|
||||
@NonNull
|
||||
@@ -725,6 +725,10 @@ public class RenderableManager {
|
||||
nSetPriority(mNativeObject, i, priority);
|
||||
}
|
||||
|
||||
public int getPriority(@EntityInstance int i) {
|
||||
return nGetPriority(mNativeObject, i);
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the channel of a renderable
|
||||
*
|
||||
@@ -734,6 +738,10 @@ public class RenderableManager {
|
||||
nSetChannel(mNativeObject, i, channel);
|
||||
}
|
||||
|
||||
public int getChannel(@EntityInstance int i) {
|
||||
return nGetChannel(mNativeObject, i);
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes whether or not frustum culling is on.
|
||||
*
|
||||
@@ -743,6 +751,10 @@ public class RenderableManager {
|
||||
nSetCulling(mNativeObject, i, enabled);
|
||||
}
|
||||
|
||||
public boolean isCullingEnabled(@EntityInstance int i) {
|
||||
return nIsCullingEnabled(mNativeObject, i);
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes whether or not the large-scale fog is applied to this renderable
|
||||
* @see Builder#fog
|
||||
@@ -812,6 +824,10 @@ public class RenderableManager {
|
||||
nSetScreenSpaceContactShadows(mNativeObject, i, enabled);
|
||||
}
|
||||
|
||||
public boolean isScreenSpaceContactShadowsEnabled(@EntityInstance int i) {
|
||||
return nIsScreenSpaceContactShadowsEnabled(mNativeObject, i);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the renderable can cast shadows.
|
||||
*
|
||||
@@ -932,6 +948,10 @@ public class RenderableManager {
|
||||
nSetBlendOrderAt(mNativeObject, instance, primitiveIndex, blendOrder);
|
||||
}
|
||||
|
||||
public int getBlendOrderAt(@EntityInstance int instance, @IntRange(from = 0) int primitiveIndex) {
|
||||
return nGetBlendOrderAt(mNativeObject, instance, primitiveIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes whether the blend order is global or local to this Renderable (by default).
|
||||
*
|
||||
@@ -946,6 +966,10 @@ public class RenderableManager {
|
||||
nSetGlobalBlendOrderEnabledAt(mNativeObject, instance, primitiveIndex, enabled);
|
||||
}
|
||||
|
||||
public boolean isGlobalBlendOrderEnabledAt(@EntityInstance int instance, @IntRange(from = 0) int primitiveIndex) {
|
||||
return nIsGlobalBlendOrderEnabledAt(mNativeObject, instance, primitiveIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the set of enabled attribute slots in the given primitive's VertexBuffer.
|
||||
*/
|
||||
@@ -1013,8 +1037,11 @@ public class RenderableManager {
|
||||
private static native void nSetAxisAlignedBoundingBox(long nativeRenderableManager, int i, float cx, float cy, float cz, float ex, float ey, float ez);
|
||||
private static native void nSetLayerMask(long nativeRenderableManager, int i, int select, int value);
|
||||
private static native void nSetPriority(long nativeRenderableManager, int i, int priority);
|
||||
private static native int nGetPriority(long nativeRenderableManager, int i);
|
||||
private static native void nSetChannel(long nativeRenderableManager, int i, int channel);
|
||||
private static native int nGetChannel(long nativeRenderableManager, int i);
|
||||
private static native void nSetCulling(long nativeRenderableManager, int i, boolean enabled);
|
||||
private static native boolean nIsCullingEnabled(long nativeRenderableManager, int i);
|
||||
private static native void nSetFogEnabled(long nativeRenderableManager, int i, boolean enabled);
|
||||
private static native boolean nGetFogEnabled(long nativeRenderableManager, int i);
|
||||
private static native void nSetLightChannel(long nativeRenderableManager, int i, int channel, boolean enable);
|
||||
@@ -1022,6 +1049,7 @@ public class RenderableManager {
|
||||
private static native void nSetCastShadows(long nativeRenderableManager, int i, boolean enabled);
|
||||
private static native void nSetReceiveShadows(long nativeRenderableManager, int i, boolean enabled);
|
||||
private static native void nSetScreenSpaceContactShadows(long nativeRenderableManager, int i, boolean enabled);
|
||||
private static native boolean nIsScreenSpaceContactShadowsEnabled(long nativeRenderableManager, int i);
|
||||
private static native boolean nIsShadowCaster(long nativeRenderableManager, int i);
|
||||
private static native boolean nIsShadowReceiver(long nativeRenderableManager, int i);
|
||||
private static native void nGetAxisAlignedBoundingBox(long nativeRenderableManager, int i, float[] center, float[] halfExtent);
|
||||
@@ -1032,6 +1060,8 @@ public class RenderableManager {
|
||||
private static native long nGetMaterialInstanceAt(long nativeRenderableManager, int i, int primitiveIndex);
|
||||
private static native void nSetGeometryAt(long nativeRenderableManager, int i, int primitiveIndex, int primitiveType, long nativeVertexBuffer, long nativeIndexBuffer, int offset, int count);
|
||||
private static native void nSetBlendOrderAt(long nativeRenderableManager, int i, int primitiveIndex, int blendOrder);
|
||||
private static native int nGetBlendOrderAt(long nativeRenderableManager, int i, int primitiveIndex);
|
||||
private static native void nSetGlobalBlendOrderEnabledAt(long nativeRenderableManager, int i, int primitiveIndex, boolean enabled);
|
||||
private static native boolean nIsGlobalBlendOrderEnabledAt(long nativeRenderableManager, int i, int primitiveIndex);
|
||||
private static native int nGetEnabledAttributesAt(long nativeRenderableManager, int i, int primitiveIndex);
|
||||
}
|
||||
|
||||
@@ -323,6 +323,7 @@ public:
|
||||
* @see Builder::blendOrder()
|
||||
* @see Builder::priority()
|
||||
* @see RenderableManager::setBlendOrderAt()
|
||||
* @see RenderableManager::getChannel()
|
||||
*/
|
||||
Builder& channel(uint8_t channel) noexcept;
|
||||
|
||||
@@ -615,6 +616,7 @@ public:
|
||||
*/
|
||||
void destroy(utils::Entity e) noexcept;
|
||||
|
||||
|
||||
/**
|
||||
* Changes the bounding box used for frustum culling.
|
||||
* The renderable must not have staticGeometry enabled.
|
||||
@@ -624,6 +626,14 @@ public:
|
||||
*/
|
||||
void setAxisAlignedBoundingBox(Instance instance, const Box& aabb);
|
||||
|
||||
/**
|
||||
* Gets the bounding box used for frustum culling.
|
||||
*
|
||||
* \see Builder::boundingBox()
|
||||
* \see RenderableManager::setAxisAlignedBoundingBox()
|
||||
*/
|
||||
const Box& getAxisAlignedBoundingBox(Instance instance) const noexcept;
|
||||
|
||||
/**
|
||||
* Changes the visibility bits.
|
||||
*
|
||||
@@ -633,6 +643,15 @@ public:
|
||||
*/
|
||||
void setLayerMask(Instance instance, uint8_t select, uint8_t values) noexcept;
|
||||
|
||||
/**
|
||||
* Get the visibility bits.
|
||||
*
|
||||
* \see Builder::layerMask()
|
||||
* \see View::setVisibleLayers().
|
||||
* \see RenderableManager::getLayerMask()
|
||||
*/
|
||||
uint8_t getLayerMask(Instance instance) const noexcept;
|
||||
|
||||
/**
|
||||
* Changes the coarse-level draw ordering.
|
||||
*
|
||||
@@ -640,6 +659,13 @@ public:
|
||||
*/
|
||||
void setPriority(Instance instance, uint8_t priority) noexcept;
|
||||
|
||||
/**
|
||||
* Get the coarse-level draw ordering.
|
||||
*
|
||||
* \see Builder::priority().
|
||||
*/
|
||||
uint8_t getPriority(Instance instance) const noexcept;
|
||||
|
||||
/**
|
||||
* Changes the channel a renderable is associated to.
|
||||
*
|
||||
@@ -647,6 +673,13 @@ public:
|
||||
*/
|
||||
void setChannel(Instance instance, uint8_t channel) noexcept;
|
||||
|
||||
/**
|
||||
* Get the channel a renderable is associated to.
|
||||
*
|
||||
* \see Builder::channel().
|
||||
*/
|
||||
uint8_t getChannel(Instance instance) const noexcept;
|
||||
|
||||
/**
|
||||
* Changes whether or not frustum culling is on.
|
||||
*
|
||||
@@ -654,6 +687,13 @@ public:
|
||||
*/
|
||||
void setCulling(Instance instance, bool enable) noexcept;
|
||||
|
||||
/**
|
||||
* Get whether or not frustum culling is on.
|
||||
*
|
||||
* \see Builder::culling()
|
||||
*/
|
||||
bool isCullingEnabled(Instance instance) const noexcept;
|
||||
|
||||
/**
|
||||
* Changes whether or not the large-scale fog is applied to this renderable
|
||||
* @see Builder::fog()
|
||||
@@ -718,6 +758,13 @@ public:
|
||||
*/
|
||||
bool isShadowReceiver(Instance instance) const noexcept;
|
||||
|
||||
/**
|
||||
* Checks if the renderable can use screen-space contact shadows.
|
||||
*
|
||||
* \see Builder::screenSpaceContactShadows().
|
||||
*/
|
||||
bool isScreenSpaceContactShadowsEnabled(Instance instance) const noexcept;
|
||||
|
||||
/**
|
||||
* Updates the bone transforms in the range [offset, offset + boneCount).
|
||||
* The bones must be pre-allocated using Builder::skinning().
|
||||
@@ -769,28 +816,13 @@ public:
|
||||
|
||||
/**
|
||||
* Gets the number of morphing in the given entity.
|
||||
* @see Builder::morphing()
|
||||
*/
|
||||
size_t getMorphTargetCount(Instance instance) const noexcept;
|
||||
|
||||
/**
|
||||
* Gets the bounding box used for frustum culling.
|
||||
*
|
||||
* \see Builder::boundingBox()
|
||||
* \see RenderableManager::setAxisAlignedBoundingBox()
|
||||
*/
|
||||
const Box& getAxisAlignedBoundingBox(Instance instance) const noexcept;
|
||||
|
||||
/**
|
||||
* Get the visibility bits.
|
||||
*
|
||||
* \see Builder::layerMask()
|
||||
* \see View::setVisibleLayers().
|
||||
* \see RenderableManager::getLayerMask()
|
||||
*/
|
||||
uint8_t getLayerMask(Instance instance) const noexcept;
|
||||
|
||||
/**
|
||||
* Gets the immutable number of primitives in the given renderable.
|
||||
* @see Builder::Builder(size_t count)
|
||||
*/
|
||||
size_t getPrimitiveCount(Instance instance) const noexcept;
|
||||
|
||||
@@ -798,6 +830,7 @@ public:
|
||||
* Returns the number of instances for this renderable.
|
||||
* @param instance Instance of the component obtained from getInstance().
|
||||
* @return The number of instances.
|
||||
* @see Builder::instances()
|
||||
*/
|
||||
size_t getInstanceCount(Instance instance) const noexcept;
|
||||
|
||||
@@ -851,6 +884,16 @@ public:
|
||||
*/
|
||||
void setBlendOrderAt(Instance instance, size_t primitiveIndex, uint16_t order) noexcept;
|
||||
|
||||
/**
|
||||
* Get the drawing order for blended primitives.
|
||||
*
|
||||
* @param instance the renderable of interest
|
||||
* @param primitiveIndex the primitive of interest
|
||||
*
|
||||
* @see Builder::blendOrder(), setGlobalBlendOrderEnabledAt()
|
||||
*/
|
||||
uint16_t getBlendOrderAt(Instance instance, size_t primitiveIndex) const noexcept;
|
||||
|
||||
/**
|
||||
* Changes whether the blend order is global or local to this Renderable (by default).
|
||||
*
|
||||
@@ -862,6 +905,16 @@ public:
|
||||
*/
|
||||
void setGlobalBlendOrderEnabledAt(Instance instance, size_t primitiveIndex, bool enabled) noexcept;
|
||||
|
||||
/**
|
||||
* Get whether the blend order is global or local to this Renderable (by default).
|
||||
*
|
||||
* @param instance the renderable of interest
|
||||
* @param primitiveIndex the primitive of interest
|
||||
*
|
||||
* @see Builder::globalBlendOrderEnabled(), setBlendOrderAt()
|
||||
*/
|
||||
bool isGlobalBlendOrderEnabledAt(Instance instance, size_t primitiveIndex) const noexcept;
|
||||
|
||||
/**
|
||||
* Retrieves the set of enabled attribute slots in the given primitive's VertexBuffer.
|
||||
*/
|
||||
|
||||
@@ -69,14 +69,26 @@ void RenderableManager::setPriority(Instance const instance, uint8_t const prior
|
||||
downcast(this)->setPriority(instance, priority);
|
||||
}
|
||||
|
||||
uint8_t RenderableManager::getPriority(Instance const instance) const noexcept {
|
||||
return downcast(this)->getPriority(instance);
|
||||
}
|
||||
|
||||
void RenderableManager::setChannel(Instance const instance, uint8_t const channel) noexcept{
|
||||
downcast(this)->setChannel(instance, channel);
|
||||
}
|
||||
|
||||
uint8_t RenderableManager::getChannel(Instance const instance) const noexcept {
|
||||
return downcast(this)->getChannel(instance);
|
||||
}
|
||||
|
||||
void RenderableManager::setCulling(Instance const instance, bool const enable) noexcept {
|
||||
downcast(this)->setCulling(instance, enable);
|
||||
}
|
||||
|
||||
bool RenderableManager::isCullingEnabled(Instance const instance) const noexcept {
|
||||
return downcast(this)->isCullingEnabled(instance);
|
||||
}
|
||||
|
||||
void RenderableManager::setCastShadows(Instance const instance, bool const enable) noexcept {
|
||||
downcast(this)->setCastShadows(instance, enable);
|
||||
}
|
||||
@@ -97,6 +109,10 @@ bool RenderableManager::isShadowReceiver(Instance const instance) const noexcept
|
||||
return downcast(this)->isShadowReceiver(instance);
|
||||
}
|
||||
|
||||
bool RenderableManager::isScreenSpaceContactShadowsEnabled(Instance const instance) const noexcept {
|
||||
return downcast(this)->isScreenSpaceContactShadowsEnabled(instance);
|
||||
}
|
||||
|
||||
const Box& RenderableManager::getAxisAlignedBoundingBox(Instance const instance) const noexcept {
|
||||
return downcast(this)->getAxisAlignedBoundingBox(instance);
|
||||
}
|
||||
@@ -131,11 +147,19 @@ void RenderableManager::setBlendOrderAt(Instance const instance, size_t const pr
|
||||
downcast(this)->setBlendOrderAt(instance, 0, primitiveIndex, order);
|
||||
}
|
||||
|
||||
uint16_t RenderableManager::getBlendOrderAt(Instance const instance, size_t const primitiveIndex) const noexcept {
|
||||
return downcast(this)->getBlendOrderAt(instance, 0, primitiveIndex);
|
||||
}
|
||||
|
||||
void RenderableManager::setGlobalBlendOrderEnabledAt(Instance const instance,
|
||||
size_t const primitiveIndex, bool const enabled) noexcept {
|
||||
downcast(this)->setGlobalBlendOrderEnabledAt(instance, 0, primitiveIndex, enabled);
|
||||
}
|
||||
|
||||
bool RenderableManager::isGlobalBlendOrderEnabledAt(Instance const instance, size_t const primitiveIndex) const noexcept {
|
||||
return downcast(this)->isGlobalBlendOrderEnabledAt(instance, 0, primitiveIndex);
|
||||
}
|
||||
|
||||
AttributeBitset RenderableManager::getEnabledAttributesAt(Instance const instance, size_t const primitiveIndex) const noexcept {
|
||||
return downcast(this)->getEnabledAttributesAt(instance, 0, primitiveIndex);
|
||||
}
|
||||
|
||||
@@ -608,7 +608,7 @@ void FRenderableManager::create(
|
||||
setFogEnabled(ci, builder->mFogEnabled);
|
||||
// do this after calling setAxisAlignedBoundingBox
|
||||
static_cast<Visibility&>(mManager[ci].visibility).geometryType = builder->mGeometryType;
|
||||
mManager[ci].channels = builder->mLightChannels;
|
||||
mManager[ci].lightChannels = builder->mLightChannels;
|
||||
|
||||
InstancesInfo& instances = manager[ci].instances;
|
||||
instances.count = builder->mInstanceCount;
|
||||
@@ -807,7 +807,7 @@ void FRenderableManager::setMaterialInstanceAt(Instance const instance, uint8_t
|
||||
assert_invariant(mi);
|
||||
if (instance) {
|
||||
Slice<FRenderPrimitive> primitives = getRenderPrimitives(instance, level);
|
||||
if (primitiveIndex < primitives.size() && mi) {
|
||||
if (primitiveIndex < primitives.size()) {
|
||||
FMaterial const* material = mi->getMaterial();
|
||||
|
||||
// we want a feature level violation to be a hard error (exception if enabled, or crash)
|
||||
@@ -864,6 +864,17 @@ void FRenderableManager::setBlendOrderAt(Instance const instance, uint8_t const
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t FRenderableManager::getBlendOrderAt(Instance const instance, uint8_t const level,
|
||||
size_t const primitiveIndex) const noexcept {
|
||||
if (instance) {
|
||||
Slice<const FRenderPrimitive> primitives = getRenderPrimitives(instance, level);
|
||||
if (primitiveIndex < primitives.size()) {
|
||||
return primitives[primitiveIndex].getBlendOrder();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void FRenderableManager::setGlobalBlendOrderEnabledAt(Instance const instance, uint8_t const level,
|
||||
size_t const primitiveIndex, bool const enabled) noexcept {
|
||||
if (instance) {
|
||||
@@ -874,6 +885,17 @@ void FRenderableManager::setGlobalBlendOrderEnabledAt(Instance const instance, u
|
||||
}
|
||||
}
|
||||
|
||||
bool FRenderableManager::isGlobalBlendOrderEnabledAt(Instance const instance, uint8_t const level,
|
||||
size_t const primitiveIndex) const noexcept {
|
||||
if (instance) {
|
||||
Slice<const FRenderPrimitive> primitives = getRenderPrimitives(instance, level);
|
||||
if (primitiveIndex < primitives.size()) {
|
||||
return primitives[primitiveIndex].isGlobalBlendOrderEnabled();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
AttributeBitset FRenderableManager::getEnabledAttributesAt(
|
||||
Instance const instance, uint8_t const level, size_t const primitiveIndex) const noexcept {
|
||||
if (instance) {
|
||||
@@ -1014,8 +1036,8 @@ void FRenderableManager::setLightChannel(Instance const ci, unsigned int const c
|
||||
if (ci) {
|
||||
if (channel < 8) {
|
||||
const uint8_t mask = 1u << channel;
|
||||
mManager[ci].channels &= ~mask;
|
||||
mManager[ci].channels |= enable ? mask : 0u;
|
||||
mManager[ci].lightChannels &= ~mask;
|
||||
mManager[ci].lightChannels |= enable ? mask : 0u;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1024,7 +1046,7 @@ bool FRenderableManager::getLightChannel(Instance const ci, unsigned int const c
|
||||
if (ci) {
|
||||
if (channel < 8) {
|
||||
const uint8_t mask = 1u << channel;
|
||||
return bool(mManager[ci].channels & mask);
|
||||
return bool(mManager[ci].lightChannels & mask);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -168,6 +168,7 @@ public:
|
||||
inline bool isShadowCaster(Instance instance) const noexcept;
|
||||
inline bool isShadowReceiver(Instance instance) const noexcept;
|
||||
inline bool isCullingEnabled(Instance instance) const noexcept;
|
||||
inline bool isScreenSpaceContactShadowsEnabled(Instance instance) const noexcept;
|
||||
|
||||
|
||||
inline Box const& getAABB(Instance instance) const noexcept;
|
||||
@@ -176,7 +177,8 @@ public:
|
||||
inline Skinning getSkinning(Instance instance) const noexcept;
|
||||
inline uint8_t getLayerMask(Instance instance) const noexcept;
|
||||
inline uint8_t getPriority(Instance instance) const noexcept;
|
||||
inline uint8_t getChannels(Instance instance) const noexcept;
|
||||
inline uint8_t getChannel(Instance instance) const noexcept;
|
||||
inline uint8_t getLightChannels(Instance instance) const noexcept;
|
||||
inline DescriptorSet& getDescriptorSet(Instance instance) noexcept;
|
||||
|
||||
struct SkinningBindingInfo {
|
||||
@@ -215,7 +217,9 @@ public:
|
||||
PrimitiveType type, FVertexBuffer* vertices, FIndexBuffer* indices,
|
||||
size_t offset, size_t count) noexcept;
|
||||
void setBlendOrderAt(Instance instance, uint8_t level, size_t primitiveIndex, uint16_t blendOrder) noexcept;
|
||||
uint16_t getBlendOrderAt(Instance instance, uint8_t level, size_t primitiveIndex) const noexcept;
|
||||
void setGlobalBlendOrderEnabledAt(Instance instance, uint8_t level, size_t primitiveIndex, bool enabled) noexcept;
|
||||
bool isGlobalBlendOrderEnabledAt(Instance instance, uint8_t level, size_t primitiveIndex) const noexcept;
|
||||
AttributeBitset getEnabledAttributesAt(Instance instance, uint8_t level, size_t primitiveIndex) const noexcept;
|
||||
inline utils::Slice<const FRenderPrimitive> getRenderPrimitives(Instance instance, uint8_t level) const noexcept;
|
||||
inline utils::Slice<FRenderPrimitive> getRenderPrimitives(Instance instance, uint8_t level) noexcept;
|
||||
@@ -259,7 +263,7 @@ private:
|
||||
AABB, // user data
|
||||
LAYERS, // user data
|
||||
MORPH_WEIGHTS, // filament data, UBO storing a pointer to the morph weights information
|
||||
CHANNELS, // user data
|
||||
LIGHT_CHANNELS, // user data
|
||||
INSTANCES, // user data
|
||||
VISIBILITY, // user data
|
||||
SKINNING, // user data
|
||||
@@ -298,7 +302,7 @@ private:
|
||||
Field<AABB> aabb;
|
||||
Field<LAYERS> layers;
|
||||
Field<MORPH_WEIGHTS> morphWeights;
|
||||
Field<CHANNELS> channels;
|
||||
Field<LIGHT_CHANNELS> lightChannels;
|
||||
Field<INSTANCES> instances;
|
||||
Field<VISIBILITY> visibility;
|
||||
Field<SKINNING> skinning;
|
||||
@@ -455,6 +459,10 @@ bool FRenderableManager::isCullingEnabled(Instance const instance) const noexcep
|
||||
return getVisibility(instance).culling;
|
||||
}
|
||||
|
||||
bool FRenderableManager::isScreenSpaceContactShadowsEnabled(Instance const instance) const noexcept {
|
||||
return getVisibility(instance).screenSpaceContactShadows;
|
||||
}
|
||||
|
||||
uint8_t FRenderableManager::getLayerMask(Instance const instance) const noexcept {
|
||||
return mManager[instance].layers;
|
||||
}
|
||||
@@ -463,8 +471,12 @@ uint8_t FRenderableManager::getPriority(Instance const instance) const noexcept
|
||||
return getVisibility(instance).priority;
|
||||
}
|
||||
|
||||
uint8_t FRenderableManager::getChannels(Instance const instance) const noexcept {
|
||||
return mManager[instance].channels;
|
||||
uint8_t FRenderableManager::getChannel(Instance const instance) const noexcept {
|
||||
return getVisibility(instance).channel;
|
||||
}
|
||||
|
||||
uint8_t FRenderableManager::getLightChannels(Instance const instance) const noexcept {
|
||||
return mManager[instance].lightChannels;
|
||||
}
|
||||
|
||||
Box const& FRenderableManager::getAABB(Instance const instance) const noexcept {
|
||||
|
||||
@@ -232,7 +232,7 @@ void FScene::prepare(JobSystem& js,
|
||||
sceneData.elementAt<INSTANCES>(index) = rcm.getInstancesInfo(ri);
|
||||
sceneData.elementAt<WORLD_AABB_CENTER>(index) = worldAABB.center;
|
||||
sceneData.elementAt<VISIBLE_MASK>(index) = 0;
|
||||
sceneData.elementAt<CHANNELS>(index) = rcm.getChannels(ri);
|
||||
sceneData.elementAt<CHANNELS>(index) = rcm.getLightChannels(ri);
|
||||
sceneData.elementAt<LAYERS>(index) = rcm.getLayerMask(ri);
|
||||
sceneData.elementAt<WORLD_AABB_EXTENT>(index) = worldAABB.halfExtent;
|
||||
//sceneData.elementAt<PRIMITIVES>(index) = {}; // already initialized, Slice<>
|
||||
|
||||
@@ -1068,7 +1068,9 @@ class_<RenderableManager>("RenderableManager")
|
||||
.function("setAxisAlignedBoundingBox", &RenderableManager::setAxisAlignedBoundingBox)
|
||||
.function("setLayerMask", &RenderableManager::setLayerMask)
|
||||
.function("setPriority", &RenderableManager::setPriority)
|
||||
.function("getPriority", &RenderableManager::getPriority)
|
||||
.function("setChannel", &RenderableManager::setChannel)
|
||||
.function("getChannel", &RenderableManager::getChannel)
|
||||
.function("setCastShadows", &RenderableManager::setCastShadows)
|
||||
.function("setReceiveShadows", &RenderableManager::setReceiveShadows)
|
||||
.function("isShadowCaster", &RenderableManager::isShadowCaster)
|
||||
@@ -1077,6 +1079,10 @@ class_<RenderableManager>("RenderableManager")
|
||||
.function("getLightChannel", &RenderableManager::getLightChannel)
|
||||
.function("setFogEnabled", &RenderableManager::setFogEnabled)
|
||||
.function("getFogEnabled", &RenderableManager::getFogEnabled)
|
||||
.function("setCulling", &RenderableManager::setCulling)
|
||||
.function("isCullingEnabled", &RenderableManager::isCullingEnabled)
|
||||
.function("setScreenSpaceContactShadows", &RenderableManager::setScreenSpaceContactShadows)
|
||||
.function("isScreenSpaceContactShadowsEnabled", &RenderableManager::isScreenSpaceContactShadowsEnabled)
|
||||
|
||||
.function("setBones", EMBIND_LAMBDA(void, (RenderableManager* self,
|
||||
RenderableManager::Instance instance, emscripten::val transforms, size_t offset), {
|
||||
@@ -1125,8 +1131,10 @@ class_<RenderableManager>("RenderableManager")
|
||||
}), allow_raw_pointers())
|
||||
|
||||
.function("setBlendOrderAt", &RenderableManager::setBlendOrderAt)
|
||||
.function("getBlendOrderAt", &RenderableManager::getBlendOrderAt)
|
||||
|
||||
.function("setGlobalBlendOrderEnabledAt", &RenderableManager::setGlobalBlendOrderEnabledAt)
|
||||
.function("isGlobalBlendOrderEnabledAt", &RenderableManager::isGlobalBlendOrderEnabledAt)
|
||||
|
||||
.function("getEnabledAttributesAt", EMBIND_LAMBDA(uint32_t, (RenderableManager* self,
|
||||
RenderableManager::Instance instance, size_t primitiveIndex), {
|
||||
|
||||
Reference in New Issue
Block a user