mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 03:53:52 +02:00
small cleanup
This commit is contained in:
parent
6572400d06
commit
d254db02dc
7 changed files with 1 additions and 39 deletions
|
@ -48,7 +48,7 @@ struct Material {
|
|||
vec4 _keySpare3;
|
||||
};
|
||||
|
||||
layout(binding=GRAPHICS_BUFFER_MATERIAL) uniform materialBuffer {
|
||||
layout(std140, binding=GRAPHICS_BUFFER_MATERIAL) uniform materialBuffer {
|
||||
Material _mat;
|
||||
TexMapArray _texMapArray;
|
||||
};
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
#define GRAPHICS_BUFFER_SKINNING 0
|
||||
#define GRAPHICS_BUFFER_MATERIAL 1
|
||||
#define GRAPHICS_BUFFER_TEXMAPARRAY 2
|
||||
#define GRAPHICS_BUFFER_KEY_LIGHT 4
|
||||
#define GRAPHICS_BUFFER_LIGHT 5
|
||||
#define GRAPHICS_BUFFER_AMBIENT_LIGHT 6
|
||||
|
@ -41,7 +40,6 @@ namespace buffer {
|
|||
enum Buffer {
|
||||
Skinning = GRAPHICS_BUFFER_SKINNING,
|
||||
Material = GRAPHICS_BUFFER_MATERIAL,
|
||||
TexMapArray = GRAPHICS_BUFFER_TEXMAPARRAY,
|
||||
Light = GRAPHICS_BUFFER_LIGHT,
|
||||
KeyLight = GRAPHICS_BUFFER_KEY_LIGHT,
|
||||
AmbientLight = GRAPHICS_BUFFER_AMBIENT_LIGHT,
|
||||
|
|
|
@ -21,7 +21,6 @@ layout(location=3) out vec4 _fragColor3; // emissive
|
|||
|
||||
// the alpha threshold
|
||||
const float alphaThreshold = 0.5;
|
||||
// FIXME: is this correct?
|
||||
float evalOpaqueFinalAlpha(float alpha, float mapAlpha) {
|
||||
return mix(alpha, 1.0 - alpha, step(mapAlpha, alphaThreshold));
|
||||
}
|
||||
|
|
|
@ -201,31 +201,6 @@ void initDeferredPipelines(render::ShapePlumber& plumber, const render::ShapePip
|
|||
addPipeline(
|
||||
Key::Builder().withMaterial().withDeformed().withDualQuatSkinned().withTranslucent().withTangents().withFade(),
|
||||
deformed_model_normal_map_translucent_fade_dq, batchSetter, itemSetter);
|
||||
|
||||
// Depth-only
|
||||
addPipeline(
|
||||
Key::Builder().withDepthOnly(),
|
||||
model_shadow, nullptr, nullptr);
|
||||
addPipeline(
|
||||
Key::Builder().withDeformed().withDepthOnly(),
|
||||
deformed_model_shadow, nullptr, nullptr);
|
||||
// Same thing but with Fade on
|
||||
addPipeline(
|
||||
Key::Builder().withDepthOnly().withFade(),
|
||||
model_shadow_fade, batchSetter, itemSetter);
|
||||
addPipeline(
|
||||
Key::Builder().withDeformed().withDepthOnly().withFade(),
|
||||
deformed_model_shadow_fade, batchSetter, itemSetter);
|
||||
|
||||
// Now repeat for dual quaternion
|
||||
// Depth-only
|
||||
addPipeline(
|
||||
Key::Builder().withDeformed().withDualQuatSkinned().withDepthOnly(),
|
||||
deformed_model_shadow_dq, nullptr, nullptr);
|
||||
// Same thing but with Fade on
|
||||
addPipeline(
|
||||
Key::Builder().withDeformed().withDualQuatSkinned().withDepthOnly().withFade(),
|
||||
deformed_model_shadow_fade_dq, batchSetter, itemSetter);
|
||||
}
|
||||
|
||||
void initForwardPipelines(ShapePlumber& plumber) {
|
||||
|
|
|
@ -31,7 +31,6 @@ layout(location=RENDER_UTILS_ATTR_NORMAL_WS) out vec3 _normalWS;
|
|||
layout(location=RENDER_UTILS_ATTR_COLOR) out vec4 _color;
|
||||
|
||||
void main(void) {
|
||||
|
||||
vec4 deformedPosition = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec3 deformedNormal = vec3(0.0, 0.0, 0.0);
|
||||
evalMeshDeformer(inPosition, deformedPosition, inNormal.xyz, deformedNormal,
|
||||
|
|
|
@ -96,7 +96,6 @@ void ShapePlumber::addPipeline(const Filter& filter, const gpu::ShaderPointer& p
|
|||
locations->lightingModelBufferUnit = program->getUniformBuffers().isValid(render_utils::slot::buffer::LightModel);
|
||||
locations->skinClusterBufferUnit = program->getUniformBuffers().isValid(graphics::slot::buffer::Skinning);
|
||||
locations->materialBufferUnit = program->getUniformBuffers().isValid(graphics::slot::buffer::Material);
|
||||
locations->texMapArrayBufferUnit = program->getUniformBuffers().isValid(graphics::slot::buffer::TexMapArray);
|
||||
locations->keyLightBufferUnit = program->getUniformBuffers().isValid(graphics::slot::buffer::KeyLight);
|
||||
locations->lightBufferUnit = program->getUniformBuffers().isValid(graphics::slot::buffer::Light);
|
||||
locations->lightAmbientBufferUnit = program->getUniformBuffers().isValid(graphics::slot::buffer::AmbientLight);
|
||||
|
|
|
@ -32,7 +32,6 @@ public:
|
|||
UNLIT,
|
||||
DEFORMED,
|
||||
DUAL_QUAT_SKINNED,
|
||||
DEPTH_ONLY,
|
||||
DEPTH_BIAS,
|
||||
WIREFRAME,
|
||||
NO_CULL_FACE,
|
||||
|
@ -80,7 +79,6 @@ public:
|
|||
Builder& withUnlit() { _flags.set(UNLIT); return (*this); }
|
||||
Builder& withDeformed() { _flags.set(DEFORMED); return (*this); }
|
||||
Builder& withDualQuatSkinned() { _flags.set(DUAL_QUAT_SKINNED); return (*this); }
|
||||
Builder& withDepthOnly() { _flags.set(DEPTH_ONLY); return (*this); }
|
||||
Builder& withDepthBias() { _flags.set(DEPTH_BIAS); return (*this); }
|
||||
Builder& withWireframe() { _flags.set(WIREFRAME); return (*this); }
|
||||
Builder& withoutCullFace() { _flags.set(NO_CULL_FACE); return (*this); }
|
||||
|
@ -133,9 +131,6 @@ public:
|
|||
Builder& withDualQuatSkinned() { _flags.set(DUAL_QUAT_SKINNED); _mask.set(DUAL_QUAT_SKINNED); return (*this); }
|
||||
Builder& withoutDualQuatSkinned() { _flags.reset(DUAL_QUAT_SKINNED); _mask.set(DUAL_QUAT_SKINNED); return (*this); }
|
||||
|
||||
Builder& withDepthOnly() { _flags.set(DEPTH_ONLY); _mask.set(DEPTH_ONLY); return (*this); }
|
||||
Builder& withoutDepthOnly() { _flags.reset(DEPTH_ONLY); _mask.set(DEPTH_ONLY); return (*this); }
|
||||
|
||||
Builder& withDepthBias() { _flags.set(DEPTH_BIAS); _mask.set(DEPTH_BIAS); return (*this); }
|
||||
Builder& withoutDepthBias() { _flags.reset(DEPTH_BIAS); _mask.set(DEPTH_BIAS); return (*this); }
|
||||
|
||||
|
@ -171,7 +166,6 @@ public:
|
|||
bool isTranslucent() const { return _flags[TRANSLUCENT]; }
|
||||
bool isDeformed() const { return _flags[DEFORMED]; }
|
||||
bool isDualQuatSkinned() const { return _flags[DUAL_QUAT_SKINNED]; }
|
||||
bool isDepthOnly() const { return _flags[DEPTH_ONLY]; }
|
||||
bool isDepthBiased() const { return _flags[DEPTH_BIAS]; }
|
||||
bool isWireframe() const { return _flags[WIREFRAME]; }
|
||||
bool isCullFace() const { return !_flags[NO_CULL_FACE]; }
|
||||
|
@ -211,7 +205,6 @@ inline QDebug operator<<(QDebug debug, const ShapeKey& key) {
|
|||
<< "isTranslucent:" << key.isTranslucent()
|
||||
<< "isDeformed:" << key.isDeformed()
|
||||
<< "isDualQuatSkinned:" << key.isDualQuatSkinned()
|
||||
<< "isDepthOnly:" << key.isDepthOnly()
|
||||
<< "isDepthBiased:" << key.isDepthBiased()
|
||||
<< "isWireframe:" << key.isWireframe()
|
||||
<< "isCullFace:" << key.isCullFace()
|
||||
|
@ -239,7 +232,6 @@ public:
|
|||
bool lightingModelBufferUnit{ false };
|
||||
bool skinClusterBufferUnit{ false };
|
||||
bool materialBufferUnit{ false };
|
||||
bool texMapArrayBufferUnit{ false };
|
||||
bool keyLightBufferUnit{ false };
|
||||
bool lightBufferUnit{ false };
|
||||
bool lightAmbientBufferUnit{ false };
|
||||
|
|
Loading…
Reference in a new issue