Skip to content
Snippets Groups Projects
Select Git revision
  • Sprint/2021-16
  • master default protected
  • gitkeep
  • dev protected
  • Issue/2583-treeBug
  • Hotfix/2504-formGen
  • Issue/2309-docs
  • Issue/2462-removeTraces
  • Hotfix/2459-EncodingPath
  • Hotfix/2452-linkedDeletion
  • Issue/1792-newMetadataStructure
  • Hotfix/2384-guestsAndLinked
  • v2.8.14-Hotfix2365
  • Hotfix/2365-targetClassWorks
  • Hotfix/2371-fixGitLabinRCV
  • Fix/xxxx-activateGitlab
  • Test/xxxx-enablingGitLab
  • Issue/2349-gitlabHttps
  • Issue/2287-guestRole
  • Hotfix/2296-selectedValuesNotReturned
  • Issue/2102-gitLabResTypeRCV
  • v2.11.5
  • v2.11.4
  • v2.11.3
  • v2.11.2
  • v2.11.1
  • v2.11.0
  • v2.10.3
  • v2.10.2
  • v2.10.1
  • v2.10.0
  • v2.9.4
  • v2.9.3
  • v2.9.2
  • v2.9.1
  • v2.9.0
  • v2.8.16
  • v2.8.15
  • v2.8.14
  • v2.8.13
  • v2.8.12
41 results

GitVersion.yml

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    fshader.glsl 840 B
    #ifdef GL_ES
    // Set default precision to medium
    precision mediump int;
    precision mediump float;
    #endif
    
    uniform mat3 n_matrix;
    uniform sampler2D texture;
    
    uniform struct Light {
        vec3 position;
        vec3 intensities;
    } light;
    
    uniform bool b_transparent;
    
    varying vec2 v_texcoord;
    varying vec4 v_position;
    varying vec3 v_normal;
    
    void main()
    {
        
        vec3 normal = normalize(n_matrix * v_normal);
    
        vec3 surfaceToLight = light.position - v_position;
        
        float brightness = dot(normal, surfaceToLight) / (length(surfaceToLight) * length(normal));
        brightness = clamp(brightness, 0, 1);
    
    	// Set fragment color from texture
    	vec4 surfaceColor = vec4(texture2D(texture, v_texcoord));
    
    	if(!b_transparent)
    	{
    		surfaceColor.a = 1.0f;
    	}
    
    	gl_FragColor = vec4(brightness * light.intensities * surfaceColor.rgb, surfaceColor.a);
    }