Skip to content
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

Merged
merged 4 commits into from
Jul 30, 2013
Merged

Sensor Lighting #985

merged 4 commits into from
Jul 30, 2013

Conversation

bagnell
Copy link
Contributor

@bagnell bagnell commented Jul 29, 2013

Make sensors render in two passes: back face and front face. Also adds ambient light to sensors.

Fixes #924.

this._pickCommand = new DrawCommand();
this._backFacePickCommand = new DrawCommand();
Copy link
Contributor

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?

@bagnell
Copy link
Contributor Author

bagnell commented Jul 29, 2013

@pjcozzi This is ready for another review.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jul 29, 2013

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);
Copy link
Contributor

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.

bagnell added 2 commits July 29, 2013 17:47
Conflicts:
	Source/Scene/CustomSensorVolume.js
@emackey
Copy link
Contributor

emackey commented Jul 30, 2013

Merging.

emackey added a commit that referenced this pull request Jul 30, 2013
@emackey emackey merged commit e77d0d2 into master Jul 30, 2013
@emackey emackey deleted the sensorLighting branch July 30, 2013 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sudden changes in lighting
3 participants