Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/modes/shaders/edit_mesh_overlay_frag.glsl
| Context not available. | |||||
| /* This shader follows the principles of | /* This shader follows the principles of | ||||
| * http://developer.download.nvidia.com/SDK/10/direct3d/Source/SolidWireframe/Doc/SolidWireframe.pdf */ | * http://developer.download.nvidia.com/SDK/10/direct3d/Source/SolidWireframe/Doc/SolidWireframe.pdf */ | ||||
| /* This is not perfect. Only a subset of intel gpus are affected. | |||||
| * This fix have some performance impact. | |||||
| * TODO Refine the range to only affect GPUs. */ | |||||
| #ifndef GPU_INTEL | |||||
| # undef INTEL_FIX | |||||
| #endif | |||||
| uniform float faceAlphaMod; | uniform float faceAlphaMod; | ||||
| flat in vec3 edgesCrease; | flat in vec3 edgesCrease; | ||||
| flat in vec3 edgesBweight; | flat in vec3 edgesBweight; | ||||
| flat in ivec3 flag; | |||||
| flat in vec4 faceColor; | flat in vec4 faceColor; | ||||
| flat in int clipCase; | flat in int clipCase; | ||||
| #ifdef VERTEX_SELECTION | #ifdef VERTEX_SELECTION | ||||
| Context not available. | |||||
| noperspective in vec4 eData1; | noperspective in vec4 eData1; | ||||
| flat in vec4 eData2; | flat in vec4 eData2; | ||||
| /* Some intel gpu have problems with having the vertex position packed. */ | |||||
| #ifdef INTEL_FIX | |||||
| flat in vec2 eData3; | |||||
| #endif | |||||
| /* Some intel Gpu seems to have memory alignement problems. So adding a padding int */ | |||||
| #ifdef GPU_INTEL | |||||
| flat in ivec4 flag; | |||||
| #else | |||||
| flat in ivec3 flag; | |||||
| #endif | |||||
| out vec4 FragColor; | out vec4 FragColor; | ||||
| Context not available. | |||||
| ivec3(2, 1, 0) | ivec3(2, 1, 0) | ||||
| ); | ); | ||||
| const mat4 stipple_matrix = mat4( | const vec4 stipple_matrix[4] = vec4[4]( | ||||
| vec4(1.0, 0.0, 0.0, 0.0), | vec4(1.0, 0.0, 0.0, 0.0), | ||||
| vec4(0.0, 0.0, 0.0, 0.0), | vec4(0.0, 0.0, 0.0, 0.0), | ||||
| vec4(0.0, 0.0, 1.0, 0.0), | vec4(0.0, 0.0, 1.0, 0.0), | ||||
| Context not available. | |||||
| p.x = distance(eData2.zw, gl_FragCoord.xy); | p.x = distance(eData2.zw, gl_FragCoord.xy); | ||||
| p.y = distance(eData2.xy, gl_FragCoord.xy); | p.y = distance(eData2.xy, gl_FragCoord.xy); | ||||
| #ifdef INTEL_FIX | |||||
| p.z = distance(eData3.xy, gl_FragCoord.xy); | |||||
| #else | |||||
| p.z = distance(eData1.zw, gl_FragCoord.xy); | p.z = distance(eData1.zw, gl_FragCoord.xy); | ||||
| #endif | |||||
| } | } | ||||
| else { | else { | ||||
| ivec3 eidxs = clipEdgeIdx[clipCase - 1]; | ivec3 eidxs = clipEdgeIdx[clipCase - 1]; | ||||
| Context not available. | |||||