Set jitter to O on RenderableWebEntityItems

This commit is contained in:
Olivier Prat 2018-04-20 12:02:17 +02:00
parent c6d598cc88
commit 46a1ff4dd2
7 changed files with 30 additions and 4 deletions

View file

@ -246,8 +246,11 @@ void WebEntityRenderer::doRender(RenderArgs* args) {
batch.setResourceTexture(0, _texture);
float fadeRatio = _isFading ? Interpolate::calculateFadeRatio(_fadeStartTime) : 1.0f;
// Turn off jitter for these entities
batch.pushProjectionJitter();
DependencyManager::get<GeometryCache>()->bindWebBrowserProgram(batch, fadeRatio < OPAQUE_ALPHA_THRESHOLD);
DependencyManager::get<GeometryCache>()->renderQuad(batch, topLeft, bottomRight, texMin, texMax, glm::vec4(1.0f, 1.0f, 1.0f, fadeRatio), _geometryId);
batch.popProjectionJitter();
}
bool WebEntityRenderer::hasWebSurface() {

View file

@ -266,11 +266,21 @@ void Batch::setProjectionTransform(const Mat4& proj) {
}
void Batch::setProjectionJitter(float jx, float jy) {
_projectionJitter.x = jx;
_projectionJitter.y = jy;
pushProjectionJitter(jx, jy);
}
void Batch::pushProjectionJitter(float jx, float jy) {
ADD_COMMAND(setProjectionJitter);
_params.emplace_back(jx);
_params.emplace_back(jy);
}
void Batch::popProjectionJitter() {
pushProjectionJitter(_projectionJitter.x, _projectionJitter.y);
}
void Batch::setViewportTransform(const Vec4i& viewport) {
ADD_COMMAND(setViewportTransform);

View file

@ -168,6 +168,9 @@ public:
void setViewTransform(const Transform& view, bool camera = true);
void setProjectionTransform(const Mat4& proj);
void setProjectionJitter(float jx = 0.0f, float jy = 0.0f);
// Very simple 1 level stack management of jitter.
void pushProjectionJitter(float jx = 0.0f, float jy = 0.0f);
void popProjectionJitter();
// Viewport is xy = low left corner in framebuffer, zw = width height of the viewport, expressed in pixels
void setViewportTransform(const Vec4i& viewport);
void setDepthRangeTransform(float nearDepth, float farDepth);
@ -498,6 +501,7 @@ public:
NamedBatchDataMap _namedData;
glm::vec2 _projectionJitter{ 0.0f, 0.0f };
bool _enableStereo{ true };
bool _enableSkybox { false };

View file

@ -283,7 +283,7 @@ const gpu::PipelinePointer& Antialiasing::getDebugBlendPipeline() {
}
void Antialiasing::configure(const Config& config) {
_sharpen = config.sharpen;
_sharpen = config.sharpen * 0.25f;
if (!_isSharpenEnabled) {
_sharpen = 0.0f;
}

View file

@ -58,7 +58,7 @@ class JitterSample {
public:
enum {
SEQUENCE_LENGTH = 16
SEQUENCE_LENGTH = 64
};
using Config = JitterSampleConfig;
@ -110,7 +110,7 @@ public:
float sharpen{ 0.05f };
bool constrainColor{ true };
float covarianceGamma{ 1.0f };
float covarianceGamma{ 0.65f };
bool feedbackColor{ false };
float debugX{ 0.0f };

View file

@ -67,6 +67,7 @@ TextureTable(0, matTex);
<@if withAlbedo@>
#define albedoMap 0
vec4 fetchAlbedoMap(vec2 uv) {
// Should take into account TAA_TEXTURE_LOD_BIAS?
return tableTexValue(matTex, albedoMap, uv);
}
<@endif@>
@ -74,6 +75,7 @@ vec4 fetchAlbedoMap(vec2 uv) {
<@if withRoughness@>
#define roughnessMap 4
float fetchRoughnessMap(vec2 uv) {
// Should take into account TAA_TEXTURE_LOD_BIAS?
return tableTexValue(matTex, roughnessMap, uv).r;
}
<@endif@>
@ -81,6 +83,7 @@ float fetchRoughnessMap(vec2 uv) {
<@if withNormal@>
#define normalMap 1
vec3 fetchNormalMap(vec2 uv) {
// Should take into account TAA_TEXTURE_LOD_BIAS?
return tableTexValue(matTex, normalMap, uv).xyz;
}
<@endif@>
@ -88,6 +91,7 @@ vec3 fetchNormalMap(vec2 uv) {
<@if withMetallic@>
#define metallicMap 2
float fetchMetallicMap(vec2 uv) {
// Should take into account TAA_TEXTURE_LOD_BIAS?
return tableTexValue(matTex, metallicMap, uv).r;
}
<@endif@>
@ -95,6 +99,7 @@ float fetchMetallicMap(vec2 uv) {
<@if withEmissive@>
#define emissiveMap 3
vec3 fetchEmissiveMap(vec2 uv) {
// Should take into account TAA_TEXTURE_LOD_BIAS?
return tableTexValue(matTex, emissiveMap, uv).rgb;
}
<@endif@>
@ -158,7 +163,7 @@ vec3 fetchEmissiveMap(vec2 uv) {
<@if withOcclusion@>
uniform sampler2D occlusionMap;
float fetchOcclusionMap(vec2 uv) {
return texture(occlusionMap, uv, TAA_TEXTURE_LOD_BIAS).r;
return texture(occlusionMap, uv).r;
}
<@endif@>

View file

@ -98,6 +98,7 @@ Rectangle {
property: "covarianceGamma"
max: 1.5
min: 0.5
height: 38
}
Separator {}
HifiControls.CheckBox {
@ -114,6 +115,7 @@ Rectangle {
property: "blend"
max: 1.0
min: 0.0
height: 38
}
ConfigSlider {
@ -162,6 +164,7 @@ Rectangle {
property: "debugShowVelocityThreshold"
max: 50
min: 0.0
height: 38
}
ConfigSlider {
label: qsTr("Debug Orb Zoom")
@ -170,6 +173,7 @@ Rectangle {
property: "debugOrbZoom"
max: 32.0
min: 1.0
height: 38
}
}
}