#1 2017-05-04 23:11:55


Changing horizon in SkyLight

Hi ! I am facing a bit of a problem !

I am using a SkyLight, and i want to lower the "ground level".


color SkyLight (
            float    Intensity = 0;        // %param Intensity={type=types.float{slidermin=-5,slidermax=2}}
            float    Turbidity = 5;        // %param Turbidity={type=types.float{min=1,max=10}}
            float    Albedo = 0.5;        // %param Albedo={type=types.float{min=-50,max=50}}
            float    Elevation = 45)        // %param Elevation={type=types.float{min=-90,slidermin=0,max=90}}
    float    elevation = Elevation*PI/180;
    vector    v = normalize (I);
    vector    s = vector (cos (elevation), sin (elevation), 0);
    float    costheta = ycomp (v);
    float    theta = acos (costheta);
    float    cosgamma = v.s;
    float    gamma = acos (cosgamma);
    float    intensity = pow (2, Intensity-5);
    return costheta > 0 ? skylight (Turbidity, Albedo, elevation, theta, gamma) * intensity : color (Albedo*ycomp (s));

The value "vector    v = normalize (I);" in the SkyLight node seems to affect the ground level. But I can't find a way to make it go away, in order to  have only my HDRI lightingin the environnement, not the ground. (I also have no clue of what "I" means...)

If someone has a solution ? That really would save me..

Thanks smile

Maurin, MoPA student



#2 2017-05-09 18:39:42

Guerilla dev, the guy to hug

Re: Changing horizon in SkyLight

You should "range" the theta attribute. It goes from [0, Pi] between up and down. Remap it to another range and it will move the horizon.

Cyril 'Hulud' Corvazier
Guerilla developer



Board footer

Powered by PunBB
© Copyright 2002–2008 PunBB