+ vec4 light_pos = light_sources[index].position;
+ return normalize(light_pos.xyz-world_vertex.xyz*light_pos.w);
+}
+
+virtual vec3 get_environment_sample(vec3 direction, float roughness)
+{
+ float lod = (2-roughness)*roughness*(textureQueryLevels(environment_map)-1);
+ return textureLod(environment_map, env_world_matrix*direction, lod).rgb;