Function three_d::renderer::light::lights_shader_source
source · pub fn lights_shader_source(
lights: &[&dyn Light],
lighting_model: LightingModel
) -> StringExpand description
Returns shader source code with the function calculate_lighting which calculate the lighting contribution for the given lights and the given LightingModel.
Use this if you want to implement a custom Material but use the default lighting calculations.
The shader function has the following signature:
vec3 calculate_lighting(vec3 camera_position, vec3 surface_color, vec3 position, vec3 normal, float metallic, float roughness, float occlusion)