Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %LIGHTS?% uniform vec3 light_pos%[nLights]%, light_color%[nLights]%; %/%
- %OMNI?% uniform vec2 omni_sfif%[nOmni]%; %/%
- %OMNI_S?% uniform vec3 omniS_mPos%[nOmniS]%; %/%
- %TARG_S?% uniform float splits[%nCsmSplits%]; %/%
- ...
- %For:i, Lights%
- {
- %i.omni?%
- vec3 vecMV = light_pos%[i]% - vecFromEye;
- float len = length(vecMV);
- vec3 lt = normalize(vecMV);
- vec3 lc = light_color%[i]% * (1.0 - clamp((len - omni_sfif%[i.omni]%.s) * omni_sfif%[i.omni]%.t, 0.0, 1.0));
- %i.omniS?%
- vec3 vecM = v_mpos - omniS_mPos%[i.omniS]%;
- lc *= CalcShadowFactor3(omniS_SM%i.omniS%, vecM);
- %/%
- diff += lc * max(dot(n2, lt), 0.0);
- %SPEC?% spec += lc * pow(max(dot(lt, r), 0.0), specPow); %/%
- %/%
- %i.targ?%
- vec3 lt = light_pos%[i]%;
- vec3 lc = light_color%[i]%;
- %i.targS?%
- {
- float sf = CalcTargShadowFactor3(zDist, splits %For:split,Csm%, targS_%i.targS%_SM%split%, targS_pmp%split%%[i.targS]% %/For%);
- lc *= sf;
- }%/%
- diff += lc * max(dot(n2, lt), 0.0);
- %SPEC?% spec += lc * pow(max(dot(lt, r), 0.0), specPow); %/%
- %/%
- }
- %/For%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement