Sha256: 77dac351b223d88884fba8b00ebe5543957fe06acd33d9d3de52fd9b9fa305d6

Contents?: true

Size: 872 Bytes

Versions: 3

Compression:

Stored size: 872 Bytes

Contents

varying vec3 v_positionMC;
varying vec3 v_positionEC;
varying vec2 v_textureCoordinates;

void main()
{
    czm_materialInput materialInput;
    
    // TODO: Real 1D distance, and better 3D coordinate
    materialInput.st = v_textureCoordinates;
    materialInput.str = vec3(v_textureCoordinates, 0.0);
    
    //Convert tangent space material normal to eye space
    materialInput.normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));
    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);
    
    //Convert view vector to world space
    vec3 positionToEyeEC = -v_positionEC; 
    materialInput.positionToEyeEC = positionToEyeEC;

    czm_material material = czm_getMaterial(materialInput);
    
    gl_FragColor = czm_phong(normalize(positionToEyeEC), material);
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cesium-0.18.0 app/assets/javascripts/Shaders/PolygonFS.glsl
cesium-0.17.0 app/assets/javascripts/Shaders/PolygonFS.glsl
cesium-0.16.0 app/assets/javascripts/Shaders/PolygonFS.glsl