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); batch.setResourceTexture(0, _texture);
float fadeRatio = _isFading ? Interpolate::calculateFadeRatio(_fadeStartTime) : 1.0f; 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>()->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); DependencyManager::get<GeometryCache>()->renderQuad(batch, topLeft, bottomRight, texMin, texMax, glm::vec4(1.0f, 1.0f, 1.0f, fadeRatio), _geometryId);
batch.popProjectionJitter();
} }
bool WebEntityRenderer::hasWebSurface() { bool WebEntityRenderer::hasWebSurface() {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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