mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-28 11:08:36 +02:00
~ | Fog parameter set to int
This commit is contained in:
@ -48,7 +48,7 @@ struct GPUVolume
|
||||
vec3 sigma_s; // scattering coefficient
|
||||
vec3 sigma_t; // extinction coefficient
|
||||
float g; // phase function parameter
|
||||
bool enabled;
|
||||
int enabled;
|
||||
};
|
||||
|
||||
layout(std430, binding = 1) buffer ObjectBuffer
|
||||
@ -167,7 +167,7 @@ vec3 pathtrace(Ray ray, inout uint rng_state)
|
||||
hitInfo hit = traceRay(ray);
|
||||
|
||||
float t_scatter = 0.0;
|
||||
if (volume.enabled && atmosScatter(hit, t_scatter, rng_state))
|
||||
if (volume.enabled != 0 && atmosScatter(hit, t_scatter, rng_state))
|
||||
{
|
||||
calculateVolumetricLight(t_scatter, ray, color, light, transmittance, rng_state);
|
||||
continue;
|
||||
@ -179,7 +179,7 @@ vec3 pathtrace(Ray ray, inout uint rng_state)
|
||||
break;
|
||||
}
|
||||
|
||||
if (volume.enabled)
|
||||
if (volume.enabled != 0)
|
||||
transmittance *= exp(-volume.sigma_t * hit.t);
|
||||
|
||||
GPUObject obj = objects[hit.obj_index];
|
||||
|
@ -2,8 +2,6 @@ hitInfo traceRay(Ray ray);
|
||||
|
||||
vec3 GetEnvironmentLight(Ray ray)
|
||||
{
|
||||
return vec3(0.);
|
||||
|
||||
vec3 sun_pos = vec3(-0.5, 0.5, 0.5);
|
||||
float SunFocus = 1.5;
|
||||
float SunIntensity = 1.;
|
||||
@ -123,6 +121,6 @@ vec3 sampleLights(vec3 position, inout uint rng_state)
|
||||
void calculateLightColor(GPUMaterial mat, hitInfo hit, inout vec3 color, inout vec3 light, inout uint rng_state)
|
||||
{
|
||||
color *= mat.color;
|
||||
light += mat.emission * mat.color;
|
||||
// light += sampleLights(hit.position, rng_state);
|
||||
// light += mat.emission * mat.color;
|
||||
light += sampleLights(hit.position, rng_state);
|
||||
}
|
Reference in New Issue
Block a user