Sha256: cb2e038837399ac00ad2f2a025d042b8d47abf3fcbc8d5bbe79eb841a9ad9ef2

Contents?: true

Size: 1.49 KB

Versions: 19

Compression:

Stored size: 1.49 KB

Contents

uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;

in vec3 vLightFront;

#ifdef DOUBLE_SIDED
  in vec3 vLightBack;
#endif

#include common
#include color_pars_fragment
#include map_pars_fragment
#include alphamap_pars_fragment
#include lightmap_pars_fragment
#include envmap_pars_fragment
#include fog_pars_fragment
#include shadowmap_pars_fragment
#include specularmap_pars_fragment
#include logdepthbuf_pars_fragment

void main() {
  vec3 outgoingLight = vec3( 0.0 );  // outgoing light does not have an alpha, the surface does
  vec4 diffuseColor = vec4( diffuse, opacity );

  #include logdepthbuf_fragment
  #include map_fragment
  #include color_fragment
  #include alphamap_fragment
  #include alphatest_fragment
  #include specularmap_fragment

  #ifdef DOUBLE_SIDED
    float isFront = float( gl_FrontFacing );
    fragColor.xyz *= isFront * vLightFront + ( 1.0 - isFront ) * vLightBack;

    if ( gl_FrontFacing )
      outgoingLight += diffuseColor.rgb * vLightFront + emissive;
    else
      outgoingLight += diffuseColor.rgb * vLightBack + emissive;
  #else
    outgoingLight += diffuseColor.rgb * vLightFront + emissive;
  #endif

  #include lightmap_fragment
  #include envmap_fragment
  #include shadowmap_fragment

  #include linear_to_gamma_fragment

  #include fog_fragment

  // fragColor = vec4( outgoingLight, diffuseColor.a );  // TODO, this should be pre-multiplied to allow for bright highlights on very transparent objects

  fragColor = vec4(outgoingLight, diffuseColor.a);
}

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
mittsu-opengl-0.5.1 lib/mittsu/opengl/shader/lib/lambert/lambert_fragment.rbsl
mittsu-0.4.1 lib/mittsu/renderers/shaders/shader_lib/lambert/lambert_fragment.rbsl
mittsu-opengl-0.5.0 lib/mittsu/opengl/shader/lib/lambert/lambert_fragment.rbsl
mittsu-0.4.0 lib/mittsu/renderers/shaders/shader_lib/lambert/lambert_fragment.rbsl
mittsu-0.3.3 lib/mittsu/renderers/shaders/shader_lib/lambert/lambert_fragment.rbsl
mittsu-0.3.2 lib/mittsu/renderers/shaders/shader_lib/lambert/lambert_fragment.rbsl
mittsu-0.3.1 lib/mittsu/renderers/shaders/shader_lib/lambert/lambert_fragment.rbsl
mittsu-0.3.0 lib/mittsu/renderers/shaders/shader_lib/lambert/lambert_fragment.rbsl
mittsu-0.2.4 lib/mittsu/renderers/shaders/shader_lib/lambert/lambert_fragment.rbsl
mittsu-0.2.3 lib/mittsu/renderers/shaders/shader_lib/lambert/lambert_fragment.rbsl
mittsu-0.2.2 lib/mittsu/renderers/shaders/shader_lib/lambert/lambert_fragment.rbsl
mittsu-0.2.1 lib/mittsu/renderers/shaders/shader_lib/lambert/lambert_fragment.rbsl
mittsu-0.2.0 lib/mittsu/renderers/shaders/shader_lib/lambert/lambert_fragment.rbsl
mittsu-0.1.7 lib/mittsu/renderers/shaders/shader_lib/lambert/lambert_fragment.rbsl
mittsu-0.1.6 lib/mittsu/renderers/shaders/shader_lib/lambert/lambert_fragment.rbsl
mittsu-0.1.5 lib/mittsu/renderers/shaders/shader_lib/lambert/lambert_fragment.rbsl
mittsu-0.1.4 lib/mittsu/renderers/shaders/shader_lib/lambert/lambert_fragment.rbsl
mittsu-0.1.3 lib/mittsu/renderers/shaders/shader_lib/lambert/lambert_fragment.rbsl
mittsu-0.1.2 lib/mittsu/renderers/shaders/shader_lib/lambert/lambert_fragment.rbsl