<commit_before>/*precision mediump float;

uniform vec4 color;
varying vec3 vnormal;
varying vec3 fragNormal, fragPosition;

void main() {
  //gl_FragColor = color;
  gl_FragColor = vec4(abs(fragNormal), 1.0);
}*/



precision mediump float;
varying vec3 fragNormal;
uniform float ambientLightAmount;
uniform float diffuseLightAmount;
uniform vec4 color;
uniform vec3 lightDir;
uniform vec3 opacity;

varying vec4 _worldSpacePosition;

uniform vec2 printableArea;

vec4 errorColor = vec4(0.15, 0.15, 0.15, 0.3);//vec4(0.15, 0.15, 0.15, 0.3);

void main () {
  vec4 depth = gl_FragCoord;

  float v = 0.8; // shadow value
  vec4 endColor = color;

  //if anything is outside the printable area, shade differently
  /*if(_worldSpacePosition.x>printableArea.x*0.5 || _worldSpacePosition.x<-printableArea.x*0.5){
    endColor = errorColor;
  }
  if(_worldSpacePosition.y>printableArea.y*0.5 || _worldSpacePosition.y<printableArea.y*-0.5) {
    endColor = errorColor;
  }*/

  vec3 ambient = ambientLightAmount * endColor.rgb;
  float cosTheta = dot(fragNormal, lightDir);
  vec3 diffuse = diffuseLightAmount * endColor.rgb * clamp(cosTheta , 0.0, 1.0 );
  gl_FragColor = vec4((ambient + diffuse * v), endColor.a);
}<commit_msg>feat(backlighting): added simple shader hack to add more homogenous lighting to models<commit_after>/*precision mediump float;

uniform vec4 color;
varying vec3 vnormal;
varying vec3 fragNormal, fragPosition;

void main() {
  //gl_FragColor = color;
  gl_FragColor = vec4(abs(fragNormal), 1.0);
}*/



precision mediump float;
varying vec3 fragNormal;
uniform float ambientLightAmount;
uniform float diffuseLightAmount;
uniform vec4 color;
uniform vec3 lightDir;
uniform vec3 opacity;

varying vec4 _worldSpacePosition;

uniform vec2 printableArea;

vec4 errorColor = vec4(0.15, 0.15, 0.15, 0.3);//vec4(0.15, 0.15, 0.15, 0.3);

void main () {
  vec4 depth = gl_FragCoord;

  float v = 0.8; // shadow value
  vec4 endColor = color;

  //if anything is outside the printable area, shade differently
  /*if(_worldSpacePosition.x>printableArea.x*0.5 || _worldSpacePosition.x<-printableArea.x*0.5){
    endColor = errorColor;
  }
  if(_worldSpacePosition.y>printableArea.y*0.5 || _worldSpacePosition.y<printableArea.y*-0.5) {
    endColor = errorColor;
  }*/

  vec3 ambient = ambientLightAmount * endColor.rgb;
  float cosTheta = dot(fragNormal, lightDir);
  vec3 diffuse = diffuseLightAmount * endColor.rgb * clamp(cosTheta , 0.0, 1.0 );

  float cosTheta2 = dot(fragNormal, vec3(-lightDir.x, -lightDir.y, lightDir.z));
  vec3 diffuse2 = diffuseLightAmount * endColor.rgb * clamp(cosTheta2 , 0.0, 1.0 );

  gl_FragColor = vec4((ambient + diffuse + diffuse2 * v), endColor.a);
}
{'fraction_non_alphanumeric': 0.12050426399703375, 'fraction_numerical': 0.04523544679273266, 'mean_word_length': 4.4505050505050505, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5008553', 'n_tokens_mistral': 1020, 'n_tokens_neox': 936, 'n_words': 237}