Pryme8 Posted May 30, 2018 Share Posted May 30, 2018 So I feel dumb... I have tried a bunch of different mixing methods and I still cant get the look I was expecting. I have a fixed light and a camera light: vec3 vLightPosition = vec3(0., 100., 2.); vec3 pLightPosition = cameraPosition; vec3 baseColor = texture2D(textureSampler, vUV).rgb; vec3 shadowColor = vec3(0.1, 0.1, 0.15); vec3 lightColor = vec3(0.3, 0.6, 0.8); vec3 vNormalW = normalize(vNormal); vec3 viewDirectionW = normalize(cameraPosition - vPositionW); vec3 lightVectorW = normalize(vLightPosition - vPositionW); vec3 plightVectorW = normalize(pLightPosition - vPositionW); float ndl = max(0., dot(vNormalW, lightVectorW)); float pndl = max(0., dot(vNormalW, plightVectorW)); vec3 angleW = normalize(viewDirectionW + lightVectorW); vec3 pangleW = normalize(viewDirectionW + plightVectorW); //float specComp = max(0., dot(vNormalW, pangleW)); //specComp = pow(specComp, max(1., 64.)) * 0.5; float lf = (pndl*PLIGHT_INTENS); vec3 color = mix(shadowColor, baseColor+(lightColor*lf), max(ndl, lf)); /* baseColor = mix(shadowColor, baseColor, ndl+lf); vec3 color = mix(baseColor, lightColor, lf); Effectively the vLight is a fixed point light or a hemi light, the pLight is the miners/camera light. I need to basically have the two lights effect each other, this math might actually by right and I am just being weird... Need any kind of input. Quote Link to comment Share on other sites More sharing options...
Guest Posted May 30, 2018 Share Posted May 30, 2018 in bjs, we just sum them (ndl + pndl) Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.