Merge branch 'master' of git://github.com/Shyotl/SingularityViewer

This commit is contained in:
Latif Khalifa
2013-11-02 12:46:16 +01:00
6 changed files with 28 additions and 21 deletions

View File

@@ -450,7 +450,9 @@ LLGLManager::LLGLManager() :
mIsGFFX(FALSE),
mATIOffsetVerticalLines(FALSE),
mATIOldDriver(FALSE),
#if LL_DARWIN
mIsMobileGF(FALSE),
#endif
mHasRequirements(TRUE),
mHasSeparateSpecularColor(FALSE),
@@ -648,6 +650,14 @@ bool LLGLManager::initGL()
{
mIsGF3 = TRUE;
}
#if LL_DARWIN
else if ((mGLRenderer.find("9400M") != std::string::npos)
|| (mGLRenderer.find("9600M") != std::string::npos)
|| (mGLRenderer.find("9800M") != std::string::npos))
{
mIsMobileGF = TRUE;
}
#endif
}
else if (mGLVendor.find("INTEL") != std::string::npos

View File

@@ -123,6 +123,11 @@ public:
BOOL mATIOffsetVerticalLines;
BOOL mATIOldDriver;
#if LL_DARWIN
// Needed to distinguish problem cards on older Macs that break with Materials
BOOL mIsMobileGF;
#endif
// Whether this version of GL is good enough for SL to use
BOOL mHasRequirements;

View File

@@ -97,12 +97,11 @@ void main()
vec4 col = defined_weight.xyxx * ccol;
// relax tolerance according to distance to avoid speckling artifacts, as angles and distances are a lot more abrupt within a small screen area at larger distances
float pointplanedist_tolerance_pow2 = pos.z*pos.z*0.00005;
float pointplanedist_tolerance_pow2 = pos.z*-0.001;
// perturb sampling origin slightly in screen-space to hide edge-ghosting artifacts where smoothing radius is quite large
float tc_mod = 0.5*(tc.x + tc.y); // mod(tc.x+tc.y,2)
tc_mod -= floor(tc_mod);
tc_mod *= 2.0;
vec2 tc_v = fract(0.5 * tc.xy); // we now have floor(mod(tc,2.0))*0.5
float tc_mod = 2.0 * abs(tc_v.x - tc_v.y); // diff of x,y makes checkerboard
tc += ( (tc_mod - 0.5) * getKern(1).z * dlt * 0.5 );
for (int i = 1; i < 4; i++)

View File

@@ -166,12 +166,12 @@ void main()
vec3 pos = vary_position;
vec4 fogged = applyWaterFogDeferred(pos, vec4(color.rgb, final_alpha));
color.rgb = fogged.rgb;
//color.a = fogged.a;
color.a = fogged.a;
#else
//color.a = final_alpha;
color.a = final_alpha;
#endif
color.a = .0;
frag_color = color;
frag_color.rgb = color.rgb;
frag_color.a = color.a;
}

View File

@@ -63,7 +63,7 @@ void main()
color.rgb = fullbrightShinyAtmosTransport(color.rgb);
color.rgb = fullbrightScaleSoftClip(color.rgb);
color.a = 0.0;
color.a = 1.0;
color.rgb = pow(color.rgb, vec3(1.0/2.2));

View File

@@ -63,7 +63,7 @@ uniform float global_gamma;
uniform float scene_light_strength;
uniform mat3 env_mat;
uniform vec4 shadow_clip;
uniform mat3 ssao_effect_mat;
uniform float ssao_effect;
uniform vec3 sun_dir;
VARYING vec2 vary_fragcoord;
@@ -256,16 +256,6 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
//increase ambient when there are more clouds
vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow * 0.5;
/* decrease value and saturation (that in HSV, not HSL) for occluded areas
* // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html
* // The following line of code performs the equivalent of:
* float ambAlpha = tmpAmbient.a;
* float ambValue = dot(vec3(tmpAmbient), vec3(0.577)); // projection onto <1/rt(3), 1/rt(3), 1/rt(3)>, the neutral white-black axis
* vec3 ambHueSat = vec3(tmpAmbient) - vec3(ambValue);
* tmpAmbient = vec4(RenderSSAOEffect.valueFactor * vec3(ambValue) + RenderSSAOEffect.saturationFactor *(1.0 - ambFactor) * ambHueSat, ambAlpha);
*/
tmpAmbient = vec4(mix(ssao_effect_mat * tmpAmbient.rgb, tmpAmbient.rgb, ambFactor), tmpAmbient.a);
//haze color
setAdditiveColor(
@@ -273,6 +263,9 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
+ (haze_horizon * haze_weight) * (sunlight*(1.-cloud_shadow) * temp2.x
+ tmpAmbient)));
// decrease ambient value for occluded areas
tmpAmbient *= mix(ssao_effect, 1.0, ambFactor);
//brightness of surface both sunlight and ambient
/*setSunlitColor(pow(vec3(sunlight * .5), vec3(global_gamma)) * global_gamma);
setAmblitColor(pow(vec3(tmpAmbient * .25), vec3(global_gamma)) * global_gamma);