Change ShapeKey::CULL to NO_CULL_FACE

This commit is contained in:
Zach Pomerantz 2016-02-08 13:44:42 -08:00
parent 9e5df79279
commit a7bafed61b
5 changed files with 14 additions and 14 deletions

View file

@ -278,7 +278,7 @@ void Circle3DOverlay::render(RenderArgs* args) {
} }
const render::ShapeKey Circle3DOverlay::getShapeKey() { const render::ShapeKey Circle3DOverlay::getShapeKey() {
auto builder = render::ShapeKey::Builder().withNoCull(); auto builder = render::ShapeKey::Builder().withoutCullFace();
if (getAlpha() != 1.0f) { if (getAlpha() != 1.0f) {
builder.withTranslucent(); builder.withTranslucent();
} }

View file

@ -104,7 +104,7 @@ void Image3DOverlay::render(RenderArgs* args) {
} }
const render::ShapeKey Image3DOverlay::getShapeKey() { const render::ShapeKey Image3DOverlay::getShapeKey() {
auto builder = render::ShapeKey::Builder().withNoCull().withDepthBias(); auto builder = render::ShapeKey::Builder().withoutCullFace().withDepthBias();
if (_emissive) { if (_emissive) {
builder.withEmissive(); builder.withEmissive();
} }

View file

@ -106,7 +106,7 @@ void Web3DOverlay::render(RenderArgs* args) {
} }
const render::ShapeKey Web3DOverlay::getShapeKey() { const render::ShapeKey Web3DOverlay::getShapeKey() {
auto builder = render::ShapeKey::Builder().withNoCull().withDepthBias(); auto builder = render::ShapeKey::Builder().withoutCullFace().withDepthBias();
if (getAlpha() != 1.0f) { if (getAlpha() != 1.0f) {
builder.withTranslucent(); builder.withTranslucent();
} }

View file

@ -135,7 +135,7 @@ void initOverlay3DPipelines(ShapePlumber& plumber) {
} }
ShapeKey::Filter::Builder builder; ShapeKey::Filter::Builder builder;
isCulled ? builder.withCull() : builder.withoutCull(); isCulled ? builder.withCullFace() : builder.withoutCullFace();
isBiased ? builder.withDepthBias() : builder.withoutDepthBias(); isBiased ? builder.withDepthBias() : builder.withoutDepthBias();
isOpaque ? builder.withOpaque() : builder.withTranslucent(); isOpaque ? builder.withOpaque() : builder.withTranslucent();
@ -154,7 +154,7 @@ void initDeferredPipelines(render::ShapePlumber& plumber) {
// These keyvalues' pipelines will be added by this lamdba in addition to the key passed // These keyvalues' pipelines will be added by this lamdba in addition to the key passed
assert(!key.isWireFrame()); assert(!key.isWireFrame());
assert(!key.isDepthBiased()); assert(!key.isDepthBiased());
assert(key.isCulled()); assert(key.isCullFace());
ShaderPointer program = gpu::Shader::createProgram(vertexShader, pixelShader); ShaderPointer program = gpu::Shader::createProgram(vertexShader, pixelShader);
@ -173,7 +173,7 @@ void initDeferredPipelines(render::ShapePlumber& plumber) {
gpu::State::FACTOR_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::ONE); gpu::State::FACTOR_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::ONE);
if (!isCulled) { if (!isCulled) {
builder.withNoCull(); builder.withoutCullFace();
} }
state->setCullMode(isCulled ? gpu::State::CULL_BACK : gpu::State::CULL_NONE); state->setCullMode(isCulled ? gpu::State::CULL_BACK : gpu::State::CULL_NONE);
if (isWireframed) { if (isWireframed) {

View file

@ -30,7 +30,7 @@ public:
DEPTH_ONLY, DEPTH_ONLY,
DEPTH_BIAS, DEPTH_BIAS,
WIREFRAME, WIREFRAME,
CULL, NO_CULL_FACE,
OWN_PIPELINE, OWN_PIPELINE,
INVALID, INVALID,
@ -41,12 +41,12 @@ public:
Flags _flags; Flags _flags;
ShapeKey() : _flags{0} { _flags.set(CULL); } ShapeKey() : _flags{ 0 } {}
ShapeKey(const Flags& flags) : _flags{flags} {} ShapeKey(const Flags& flags) : _flags{flags} {}
class Builder { class Builder {
public: public:
Builder() { _flags.set(CULL); } Builder() {}
Builder(ShapeKey key) : _flags{key._flags} {} Builder(ShapeKey key) : _flags{key._flags} {}
ShapeKey build() const { return ShapeKey{_flags}; } ShapeKey build() const { return ShapeKey{_flags}; }
@ -61,7 +61,7 @@ public:
Builder& withDepthOnly() { _flags.set(DEPTH_ONLY); return (*this); } Builder& withDepthOnly() { _flags.set(DEPTH_ONLY); return (*this); }
Builder& withDepthBias() { _flags.set(DEPTH_BIAS); return (*this); } Builder& withDepthBias() { _flags.set(DEPTH_BIAS); return (*this); }
Builder& withWireframe() { _flags.set(WIREFRAME); return (*this); } Builder& withWireframe() { _flags.set(WIREFRAME); return (*this); }
Builder& withNoCull() { _flags.reset(CULL); return (*this); } Builder& withoutCullFace() { _flags.reset(NO_CULL_FACE); return (*this); }
Builder& withOwnPipeline() { _flags.set(OWN_PIPELINE); return (*this); } Builder& withOwnPipeline() { _flags.set(OWN_PIPELINE); return (*this); }
Builder& invalidate() { _flags.set(INVALID); return (*this); } Builder& invalidate() { _flags.set(INVALID); return (*this); }
@ -117,8 +117,8 @@ public:
Builder& withWireframe() { _flags.set(WIREFRAME); _mask.set(WIREFRAME); return (*this); } Builder& withWireframe() { _flags.set(WIREFRAME); _mask.set(WIREFRAME); return (*this); }
Builder& withoutWireframe() { _flags.reset(WIREFRAME); _mask.set(WIREFRAME); return (*this); } Builder& withoutWireframe() { _flags.reset(WIREFRAME); _mask.set(WIREFRAME); return (*this); }
Builder& withCull() { _flags.set(CULL); _mask.set(CULL); return (*this); } Builder& withCullFace() { _flags.reset(NO_CULL_FACE); _mask.set(NO_CULL_FACE); return (*this); }
Builder& withoutCull() { _flags.reset(CULL); _mask.set(CULL); return (*this); } Builder& withoutCullFace() { _flags.set(NO_CULL_FACE); _mask.set(NO_CULL_FACE); return (*this); }
protected: protected:
friend class Filter; friend class Filter;
@ -142,7 +142,7 @@ public:
bool isDepthOnly() const { return _flags[DEPTH_ONLY]; } bool isDepthOnly() const { return _flags[DEPTH_ONLY]; }
bool isDepthBiased() const { return _flags[DEPTH_BIAS]; } bool isDepthBiased() const { return _flags[DEPTH_BIAS]; }
bool isWireFrame() const { return _flags[WIREFRAME]; } bool isWireFrame() const { return _flags[WIREFRAME]; }
bool isCulled() const { return _flags[CULL]; } bool isCullFace() const { return !_flags[NO_CULL_FACE]; }
bool hasOwnPipeline() const { return _flags[OWN_PIPELINE]; } bool hasOwnPipeline() const { return _flags[OWN_PIPELINE]; }
bool isValid() const { return !_flags[INVALID]; } bool isValid() const { return !_flags[INVALID]; }
@ -178,7 +178,7 @@ inline QDebug operator<<(QDebug debug, const ShapeKey& key) {
<< "isDepthOnly:" << key.isDepthOnly() << "isDepthOnly:" << key.isDepthOnly()
<< "isDepthBiased:" << key.isDepthBiased() << "isDepthBiased:" << key.isDepthBiased()
<< "isWireFrame:" << key.isWireFrame() << "isWireFrame:" << key.isWireFrame()
<< "isCulled:" << key.isCulled() << "isCullFace:" << key.isCullFace()
<< "]"; << "]";
} }
} else { } else {