mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	Tech ENABLE_GL_SHADERS_ATTRIBUTES - Added shaders for glsl version 140
(cherry picked from commit prusa3d/PrusaSlicer@76d1d4949b)
This commit is contained in:
		
							parent
							
								
									bb044754af
								
							
						
					
					
						commit
						1e4f16bd39
					
				
					 76 changed files with 1145 additions and 143 deletions
				
			
		
							
								
								
									
										34
									
								
								resources/shaders/110/printbed.fs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								resources/shaders/110/printbed.fs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,34 @@
 | 
			
		|||
#version 110
 | 
			
		||||
 | 
			
		||||
const vec3 back_color_dark  = vec3(0.235, 0.235, 0.235);
 | 
			
		||||
const vec3 back_color_light = vec3(0.365, 0.365, 0.365);
 | 
			
		||||
 | 
			
		||||
uniform sampler2D texture;
 | 
			
		||||
uniform bool transparent_background;
 | 
			
		||||
uniform bool svg_source;
 | 
			
		||||
 | 
			
		||||
varying vec2 tex_coord;
 | 
			
		||||
 | 
			
		||||
vec4 svg_color()
 | 
			
		||||
{
 | 
			
		||||
    // takes foreground from texture
 | 
			
		||||
    vec4 fore_color = texture2D(texture, tex_coord);
 | 
			
		||||
 | 
			
		||||
    // calculates radial gradient
 | 
			
		||||
    vec3 back_color = vec3(mix(back_color_light, back_color_dark, smoothstep(0.0, 0.5, length(abs(tex_coord.xy) - vec2(0.5)))));
 | 
			
		||||
 | 
			
		||||
    // blends foreground with background
 | 
			
		||||
    return vec4(mix(back_color, fore_color.rgb, fore_color.a), transparent_background ? fore_color.a : 1.0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
vec4 non_svg_color()
 | 
			
		||||
{
 | 
			
		||||
    // takes foreground from texture
 | 
			
		||||
    vec4 color = texture2D(texture, tex_coord);
 | 
			
		||||
    return vec4(color.rgb, transparent_background ? color.a * 0.25 : color.a);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void main()
 | 
			
		||||
{
 | 
			
		||||
    gl_FragColor = svg_source ? svg_color() : non_svg_color();
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue