Skip to content

Commit

Permalink
Fix textureOffset bug on AMD graphics cards
Browse files Browse the repository at this point in the history
  • Loading branch information
kmkolasinski committed Mar 1, 2017
1 parent 8e4d630 commit f71d77e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Sources/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ int main(int argc, char *argv[])
regABSliderDelegates();
regABColorDelegates();

// qInstallMessageHandler(customMessageHandler);
qInstallMessageHandler(customMessageHandler);

qDebug() << "Starting application:";
qDebug() << "Application dir:" << QApplication::applicationDirPath();
Expand Down
22 changes: 3 additions & 19 deletions Sources/resources/shaders/filters.frag
Original file line number Diff line number Diff line change
Expand Up @@ -1060,11 +1060,11 @@ vec4 mode_height_to_normal(){
vec4 ffilter(){
#endif


const vec2 size = vec2(1.0,0.0);
const ivec3 off = ivec3(-1,0,1);
const ivec2 dx = ivec2(1,0);
const ivec2 dy = ivec2(0,1);
#define dx ivec2(1, 0)
#define dy ivec2(0, 1)

vec2 tex_coord = v2QuadCoords.st;
highp float R0 = texture(layerA, tex_coord).x;

Expand All @@ -1082,22 +1082,6 @@ vec4 ffilter(){
dRy = normalize(vec3(-size.yx,gui_hn_conversion_depth*(Ry-R0)));
bump = bump + normalize( cross(dRx,dRy) );

// // (-dx,dy)
// Rx = textureOffset(layerA, tex_coord, -dx).x;
// Ry = textureOffset(layerA, tex_coord, dy).x;
// dRx = normalize(vec3(-size.xy,gui_hn_conversion_depth*(Rx-R0)));
// dRy = normalize(vec3( size.yx,gui_hn_conversion_depth*(Ry-R0)));
// bump = bump - normalize( cross(dRx,dRy) );

// // (dx,-dy)
// Rx = textureOffset(layerA, tex_coord, dx).x;
// Ry = textureOffset(layerA, tex_coord, -dy).x;
// dRx = normalize(vec3( size.xy,gui_hn_conversion_depth*(Rx-R0)));
// dRy = normalize(vec3(-size.yx,gui_hn_conversion_depth*(Ry-R0)));
// bump = bump - normalize( cross(dRx,dRy) );



bump = normalize(bump);
return vec4(clamp(bump*0.5 + 0.5,vec3(0),vec3(1)),1);
}
Expand Down

0 comments on commit f71d77e

Please sign in to comment.