-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sensor Lighting #985
Sensor Lighting #985
Conversation
…s ambient light to sensors.
this._pickCommand = new DrawCommand(); | ||
this._backFacePickCommand = new DrawCommand(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does picking need separate back and front face passes? Can't this be done in one pass since we only care about the pick id (color), not the shading?
@pjcozzi This is ready for another review. |
Code is OK with me. @emackey do you want to test and merge? |
|
||
czm_material material = czm_getMaterial(materialInput); | ||
return czm_phong(normalize(positionToEyeEC), material); | ||
return mix(czm_phong(normalize(positionToEyeEC), material), vec4(material.diffuse, material.alpha), 0.4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long-term, we should figure out a better solution than hard-coding values like 0.4 here. The problem is czm_phong uses "fake" light vectors in an attempt to ensure abstract objects are always lit for visibility, but, there are certain camera angles (particularly on translucent objects like sensor cones) where the diffuse light still falls to zero. So here, we've mapped [0.0, 1.0] to [0.4, 1.0] to emulate ambient light, preventing the color from reaching full black.
Ideally, as @mramato suggested in #925, there would be a scene-level ambient light setting, that would apply the above mix
to all phong lighting in the scene using a user-supplied value.
Conflicts: Source/Scene/CustomSensorVolume.js
Merging. |
Make sensors render in two passes: back face and front face. Also adds ambient light to sensors.
Fixes #924.