using the textureGather lookup

This commit is contained in:
samcake 2016-07-18 12:52:21 -07:00
parent be4839d46c
commit 80587ca8a3
4 changed files with 5 additions and 18 deletions

View file

@ -146,7 +146,7 @@ class SurfaceGeometryPassConfig : public render::Job::Config {
public: public:
SurfaceGeometryPassConfig() : render::Job::Config(true) {} SurfaceGeometryPassConfig() : render::Job::Config(true) {}
float depthThreshold{ 0.02f }; // meters float depthThreshold{ 0.005f }; // meters
float basisScale{ 1.0f }; float basisScale{ 1.0f };
float curvatureScale{ 10.0f }; float curvatureScale{ 10.0f };
int resolutionLevel{ 0 }; int resolutionLevel{ 0 };

View file

@ -45,7 +45,6 @@ out vec4 outLinearDepth;
out vec4 outNormal; out vec4 outNormal;
void main(void) { void main(void) {
#if __VERSION__ == 450
// Gather 2 by 2 quads from texture // Gather 2 by 2 quads from texture
vec4 Zeyes = textureGather(linearDepthMap, varTexCoord0, 0); vec4 Zeyes = textureGather(linearDepthMap, varTexCoord0, 0);
@ -60,7 +59,7 @@ void main(void) {
normal += unpackNormal(vec3(rawNormalsX[1], rawNormalsY[1], rawNormalsZ[1])); normal += unpackNormal(vec3(rawNormalsX[1], rawNormalsY[1], rawNormalsZ[1]));
normal += unpackNormal(vec3(rawNormalsX[2], rawNormalsY[2], rawNormalsZ[2])); normal += unpackNormal(vec3(rawNormalsX[2], rawNormalsY[2], rawNormalsZ[2]));
normal += unpackNormal(vec3(rawNormalsX[3], rawNormalsY[3], rawNormalsZ[3])); normal += unpackNormal(vec3(rawNormalsX[3], rawNormalsY[3], rawNormalsZ[3]));
#else /*
ivec2 texpos = ivec2(gl_FragCoord.xy) * 2; ivec2 texpos = ivec2(gl_FragCoord.xy) * 2;
vec4 Zeyes; vec4 Zeyes;
@ -83,7 +82,7 @@ void main(void) {
normal += unpackNormal(rawNormals[1]); normal += unpackNormal(rawNormals[1]);
normal += unpackNormal(rawNormals[2]); normal += unpackNormal(rawNormals[2]);
normal += unpackNormal(rawNormals[3]); normal += unpackNormal(rawNormals[3]);
#endif */
normal = normalize(normal); normal = normalize(normal);

View file

@ -58,19 +58,7 @@ Column {
"Ambient:LightingModel:enableAmbientLight", "Ambient:LightingModel:enableAmbientLight",
"Directional:LightingModel:enableDirectionalLight", "Directional:LightingModel:enableDirectionalLight",
"Point:LightingModel:enablePointLight", "Point:LightingModel:enablePointLight",
"Spot:LightingModel:enableSpotLight" "Spot:LightingModel:enableSpotLight",
]
CheckBox {
text: modelData.split(":")[0]
checked: Render.getConfig(modelData.split(":")[1])[modelData.split(":")[2]]
onCheckedChanged: { Render.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked }
}
}
}
Column {
spacing: 10
Repeater {
model: [
"Light Contour:LightingModel:showLightContour" "Light Contour:LightingModel:showLightContour"
] ]
CheckBox { CheckBox {

View file

@ -20,7 +20,7 @@ Column {
Column{ Column{
Repeater { Repeater {
model: [ model: [
"Depth Threshold:depthThreshold:0.1:false", "Depth Threshold:depthThreshold:0.05:false",
"Basis Scale:basisScale:2.0:false", "Basis Scale:basisScale:2.0:false",
"Curvature Scale:curvatureScale:100.0:false", "Curvature Scale:curvatureScale:100.0:false",
"Downscale:resolutionLevel:4:true" "Downscale:resolutionLevel:4:true"