<commit_before>pub fn dirt() -> String {
  struct Wave {
    freq: f32,
    amp: f32,
  }

  let mut waves = Vec::new();
  for i in 0..10 {
    waves.push(
      Wave { freq:  ((1 << i) as f32) / 4.0, amp: 1.0 / (1 << i) as f32 }
    );
  }

  let mut contents = String::new();
  for wave in waves.iter() {
    contents.push_str(format!(r#"
    {{
      float freq = {};
      float amp = {};

      float dnoise = abs(cnoise(freq * world_position));
      noise += dnoise * amp;
      total_amp += amp;
    }}
    "#, wave.freq, wave.amp).as_str());
  }

  format!(r#"
  float total_amp = 0.0;
  float noise = 0.0;
  {}
  noise /= total_amp;
  return mix(vec3(0.4, 0.3, 0.1), vec3(0.7, 0.6, 0.4), noise);
  "#, contents)
}<commit_msg>tweak dirt shader<commit_after>pub fn dirt() -> String {
  struct Wave {
    freq: f32,
    amp: f32,
  }

  let mut waves = Vec::new();
  for i in 0..10 {
    waves.push(
      Wave { freq: (1 << i) as f32, amp: 1.0 / (1 << i) as f32 }
    );
  }

  let mut contents = String::new();
  for wave in waves.iter() {
    contents.push_str(format!(r#"
    {{
      float freq = {};
      float amp = {};

      float dnoise = abs(cnoise(freq * world_position));
      noise += dnoise * amp;
      total_amp += amp;
    }}
    "#, wave.freq, wave.amp).as_str());
  }

  format!(r#"
  float total_amp = 0.0;
  float noise = 0.0;
  {}
  noise /= total_amp;
  return mix(vec3(0.4, 0.3, 0.1), vec3(0.7, 0.6, 0.4), noise);
  "#, contents)
}
{'fraction_non_alphanumeric': 0.18976109215017065, 'fraction_numerical': 0.04641638225255973, 'mean_word_length': 2.1594827586206895, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 5, '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': '4090188', 'n_tokens_mistral': 644, 'n_tokens_neox': 584, 'n_words': 149}