Ajout du projet Depths sur Git

This commit is contained in:
2026-04-30 12:24:52 +02:00
commit a143ea22c7
6651 changed files with 77423 additions and 0 deletions
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<materialx version="1.38">
<!-- <point_light> -->
<implementation name="IM_point_light_genmsl" nodedef="ND_point_light" file="mx_point_light.metal" function="mx_point_light" target="genmsl" />
<!-- <directional_light> -->
<implementation name="IM_directional_light_genmsl" nodedef="ND_directional_light" file="mx_directional_light.metal" function="mx_directional_light" target="genmsl" />
<!-- <spot_light> -->
<implementation name="IM_spot_light_genmsl" nodedef="ND_spot_light" file="mx_spot_light.metal" function="mx_spot_light" target="genmsl" />
</materialx>
@@ -0,0 +1,5 @@
void mx_directional_light(LightData light, float3 position, thread lightshader& result)
{
result.direction = -light.direction;
result.intensity = light.color * light.intensity;
}
@@ -0,0 +1,8 @@
void mx_point_light(LightData light, float3 position, thread lightshader& result)
{
result.direction = light.position - position;
float distance = length(result.direction) + M_FLOAT_EPS;
float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS);
result.intensity = light.color * light.intensity / attenuation;
result.direction /= distance;
}
@@ -0,0 +1,13 @@
void mx_spot_light(LightData light, float3 position, thread lightshader& result)
{
result.direction = light.position - position;
float distance = length(result.direction) + M_FLOAT_EPS;
float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS);
result.intensity = light.color * light.intensity / attenuation;
result.direction /= distance;
float low = min(light.inner_angle, light.outer_angle);
float high = light.inner_angle;
float cosDir = dot(result.direction, -light.direction);
float spotAttenuation = smoothstep(low, high, cosDir);
result.intensity *= spotAttenuation;
}