mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Maybe fixed the problem, cannot render the gl41 version properly
This commit is contained in:
parent
53642763c9
commit
9139edc8b1
5 changed files with 20 additions and 14 deletions
|
@ -55,9 +55,11 @@ void PolyLineEntityRenderer::buildPipelines() {
|
|||
|
||||
state->setCullMode(gpu::State::CullMode::CULL_NONE);
|
||||
state->setDepthTest(true, !key.second, gpu::LESS_EQUAL);
|
||||
PrepareStencil::testMaskDrawShape(*state);
|
||||
// PrepareStencil::testMaskDrawShape(*state);
|
||||
PrepareStencil::testMask(*state);
|
||||
|
||||
state->setBlendFunction(true, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA);
|
||||
state->setBlendFunction(true, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA,
|
||||
gpu::State::FACTOR_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::ONE);
|
||||
|
||||
_pipelines[key] = gpu::Pipeline::create(program, state);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ layout(location=3) in float _distanceFromCenter;
|
|||
void main(void) {
|
||||
vec4 texel = texture(_texture, _texCoord);
|
||||
texel *= _color;
|
||||
texel.a *= mix(1.0, pow(1.0 - abs(_distanceFromCenter), 10.0), _polylineData.faceCameraGlow.y);
|
||||
texel.a *= mix(1.0, pow(1.0 - min(1.0, abs(_distanceFromCenter)), 10.0), _polylineData.faceCameraGlow.y);
|
||||
|
||||
<@if not HIFI_USE_FORWARD@>
|
||||
packDeferredFragmentTranslucent((2.0 * float(gl_FrontFacing) - 1.0) * _normalWS, texel.a, texel.rgb, DEFAULT_ROUGHNESS);
|
||||
|
|
|
@ -48,6 +48,18 @@ using namespace render;
|
|||
|
||||
extern void initForwardPipelines(ShapePlumber& plumber);
|
||||
|
||||
void PreparePrimaryFramebufferMSAAConfig::setResolutionScale(float scale) {
|
||||
const float SCALE_RANGE_MIN = 0.1f;
|
||||
const float SCALE_RANGE_MAX = 2.0f;
|
||||
resolutionScale = std::max(SCALE_RANGE_MIN, std::min(SCALE_RANGE_MAX, scale));
|
||||
// emit dirty();
|
||||
}
|
||||
|
||||
void PreparePrimaryFramebufferMSAAConfig::setNumSamples(int num) {
|
||||
numSamples = std::max(1, std::min(32, num));
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void RenderForwardTask::configure(const Config& config) {
|
||||
// Propagate resolution scale to sub jobs who need it
|
||||
auto preparePrimaryBufferConfig = config.getConfig<PreparePrimaryFramebufferMSAA>("PreparePrimaryBufferForward");
|
||||
|
|
|
@ -46,18 +46,10 @@ class PreparePrimaryFramebufferMSAAConfig : public render::Job::Config {
|
|||
Q_PROPERTY(int numSamples WRITE setNumSamples READ getNumSamples)
|
||||
public:
|
||||
float getResolutionScale() const { return resolutionScale; }
|
||||
void setResolutionScale(float scale) {
|
||||
const float SCALE_RANGE_MIN = 0.1f;
|
||||
const float SCALE_RANGE_MAX = 2.0f;
|
||||
resolutionScale = std::max(SCALE_RANGE_MIN, std::min(SCALE_RANGE_MAX, scale));
|
||||
//emit dirty();
|
||||
}
|
||||
void setResolutionScale(float scale);
|
||||
|
||||
int getNumSamples() const { return numSamples; }
|
||||
void setNumSamples(int num) {
|
||||
numSamples = std::max(1, std::min(32, num));
|
||||
emit dirty();
|
||||
}
|
||||
void setNumSamples(int num);
|
||||
|
||||
signals:
|
||||
void dirty();
|
||||
|
|
|
@ -35,7 +35,7 @@ Column{
|
|||
object: Render.getConfig("RenderMainView.PreparePrimaryBufferForward")
|
||||
property: "numSamples"
|
||||
min: 1
|
||||
max: 4
|
||||
max: 32
|
||||
integral: true
|
||||
}
|
||||
Row {
|
||||
|
|
Loading…
Reference in a new issue