typedef image(dimensions=cube, shadow, sampled) float samplerCubeShadow;
typedef image(dimensions=cube[], shadow, sampled) float samplerCubeArrayShadow;
+const float PI = 3.1415926535;
+
// BEGIN BUILTIN FUNCTIONS
float radians(float degrees);
vec2 radians(vec2 degrees);
uniform samplerCube environment_map;
-const float PI = 3.1415926535;
-
vec2 hammersley(int i, int count)
{
float y = bitfieldReverse(uint(i))*2.3283064e-10;
vec3 luminance;
};
-const float pi = 3.1415926535;
const float mie_asymmetry = 0.8;
uniform sampler2D transmittance_lookup;
float rayleigh_phase(float cos_theta)
{
- return 3.0*(1.0+cos_theta*cos_theta)/(16.0*pi);
+ return 3.0*(1.0+cos_theta*cos_theta)/(16.0*PI);
}
vec3 mie_density(vec3 base, float height)
float g = mie_asymmetry;
float num = (1.0-g*g)*(1.0+cos_theta*cos_theta);
float denom = (2.0+g*g)*pow(1.0+g*g-2.0*g*cos_theta, 1.5);
- return 3.0/(8.0*pi)*num/denom;
+ return 3.0/(8.0*PI)*num/denom;
}
vec3 ozone_density(vec3 base, float height)
vec3 in_transmittance = texture(transmittance_lookup, vec2(sqrt(height/atmosphere_thickness), light_z)).rgb;
vec3 in_luminance = (ev.rayleigh_scatter*p_rayleigh+ev.mie_scatter*p_mie)*step_size;
if(i==n_steps && ground_t>0.0)
- in_luminance += ground_albedo*light_z/pi;
+ in_luminance += ground_albedo*light_z/PI;
path_luminance += transmittance*in_transmittance*in_luminance;
path_extinction += total_extinction(ev)*step_size;
{
vec3 nview = normalize(view_dir.xyz);
float azimuth = atan(nview.y, nview.x);
- frag_color = texture(distant, vec2(azimuth/(2*pi), nview.z*0.5+0.5))*light_color;
+ frag_color = texture(distant, vec2(azimuth/(2*PI), nview.z*0.5+0.5))*light_color;
}
layout(location=0) out vec3 frag_color;
void main()
{
- float azimuth = texcoord.x*2.0*pi;
+ float azimuth = texcoord.x*2.0*PI;
float z = texcoord.y*2.0-1.0;
float r = sqrt(1.0-z*z);
vec3 look_dir = vec3(cos(azimuth)*r, sin(azimuth)*r, z);
layout(constant_id=auto) const bool use_emission_map = false;
layout(constant_id=auto) const bool use_image_based_lighting = false;
-const float PI = 3.1415926535;
-
#pragma MSP stage(fragment)
virtual vec4 get_base_color()
{