Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %OMNI_A?%
- uniform vec3 omni_pos%[nOmniA]%, omni_color%[nOmniA]%;
- uniform vec2 omni_sfif%[nOmniA]%;
- %/%
- %OMNI_S?%
- uniform vec3 omniS_pos%[nOmniS]%, omniS_mPos%[nOmniS]%, omniS_color%[nOmniS]%;
- uniform vec2 omniS_sfif%[nOmniS]%;
- %/%
- %TARG_A?%
- uniform vec3 targ_pos%[nTargA]%, targ_color%[nTargA]%;
- %/%
- %TARG_S?%
- uniform float splits[%nCsmSplits%];
- uniform vec3 targS_pos%[nTargS]%, targS_color%[nTargS]%;
- %/%
- ...
- %For:i,OmniA%
- {
- vec3 vecMV = omni_pos%[i]% - vecFromEye;
- float len = length(vecMV);
- vec3 lt = normalize(vecMV);
- vec3 lc = omni_color%[i]% * (1.0 - clamp((len - omni_sfif%[i]%.s) * omni_sfif%[i]%.t, 0.0, 1.0));
- diff += lc * max(dot(n2, lt), 0.0);
- %SPEC?% spec += lc * pow(max(dot(lt, r), 0.0), specPow); %/%
- }
- %/For%
- %For:i,OmniS%
- {
- vec3 vecMV = omniS_pos%[i]% - vecFromEye, vecM = v_mpos - omniS_mPos%[i]%;
- float len = length(vecMV);
- vec3 lt = normalize(vecMV);
- float shadowFactor = CalcShadowFactor3(omniS_SM%i%, vecM);
- vec3 lc = omniS_color%[i]% * (1.0 - clamp((len - omniS_sfif%[i]%.s) * omniS_sfif%[i]%.t, 0.0, 1.0)) * shadowFactor;
- diff += lc * max(dot(n2, lt), 0.0);
- %SPEC?% spec += lc * pow(max(dot(lt, r), 0.0), specPow); %/%
- }
- %/For%
- %For:i,TargA%
- {
- vec3 lt = targ_pos%[i]%;
- vec3 lc = targ_color%[i]%;
- diff += lc * max(dot(n2, lt), 0.0);
- %SPEC?% spec += lc * pow(max(dot(lt, r), 0.0), specPow); %/%
- }
- %/For%
- %For:i,TargS%
- {
- vec3 lt = targS_pos%[i]%;
- float sf = CalcTargShadowFactor3(zDist, splits %For:split,Csm%, targS_%i%_SM%split%, targS_pmp%split%%[i]% %/For%);
- vec3 lc = targS_color%[i]% * 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