HardwareRenderer.SetLightSourceGeometry Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the center of the light source.
[Android.Runtime.Register("setLightSourceGeometry", "(FFFF)V", "GetSetLightSourceGeometry_FFFFHandler", ApiSince=29)]
public virtual void SetLightSourceGeometry (float lightX, float lightY, float lightZ, float lightRadius);
[<Android.Runtime.Register("setLightSourceGeometry", "(FFFF)V", "GetSetLightSourceGeometry_FFFFHandler", ApiSince=29)>]
abstract member SetLightSourceGeometry : single * single * single * single -> unit
override this.SetLightSourceGeometry : single * single * single * single -> unit
Parameters
- lightX
- Single
The X position of the light source
- lightY
- Single
The Y position of the light source
- lightZ
- Single
The Z position of the light source. Must be >= 0.
- lightRadius
- Single
The radius of the light source. Smaller radius will have sharper edges, larger radius will have softer shadows.
- Attributes
Remarks
Sets the center of the light source. The light source point controls the directionality and shape of shadows rendered by RenderNode Z & elevation.
The platform's recommendation is to set lightX to 'displayWidth / 2f - windowLeft', set lightY to 0 - windowTop, lightZ set to 600dp, and lightRadius to 800dp.
The light source should be setup both as part of initial configuration, and whenever the window moves to ensure the light source stays anchored in display space instead of in window space.
This must be set at least once along with #setLightSourceAlpha(float, float)
before shadows will work.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.