Ejemplo n.º 1
0
 ///the VisibleLight struct is rather big. pass the argument by reference
 void SetupDirectionalLight(int index, ref VisibleLight visibleLight)
 {
     dirLightColors[index] = visibleLight.finalColor;
     ///光照的forward方向,for example forward(0,0,1,0), right(1,0,0,0,), up(0,1,0,0)
     dirLightDirections[index] = -visibleLight.localToWorldMatrix.GetColumn(2);
     shadows.ReserveDirectionalShadows(visibleLight.light, index);
 }
Ejemplo n.º 2
0
 void SetupDirectionalLight(int index, ref VisibleLight visibleLight)
 {
     dirLightColors[index]     = visibleLight.finalColor;
     dirLightDirections[index] = -visibleLight.localToWorldMatrix.GetColumn(2);
     dirLightShadowData[index] =
         shadows.ReserveDirectionalShadows(visibleLight.light, index);
 }
Ejemplo n.º 3
0
 private void SetupDirectionalLight(int index, ref VisibleLight visibleLight)
 {
     dirLightColors[index] = visibleLight.finalColor;
     dirLightDirectionsOrPositions[index] = -visibleLight.localToWorldMatrix.GetColumn(2);
     dirLightShadowData[index]            = shadows.ReserveDirectionalShadows(visibleLight.light, index);
     dirLightRange[index]   = Vector4.zero;
     dirLightRange[index].y = shadowTreshold;
 }
Ejemplo n.º 4
0
 void SetupDirectionalLight(int index, ref VisibleLight visibleLight)
 {
     Light light = RenderSettings.sun;
     // buffer.SetGlobalVector(dirLightColorId, light.color.linear * light.intensity);
     // buffer.SetGlobalVector(dirLightDirectionId, -light.transform.forward);
     dirLightColors[index] = visibleLight.finalColor;
     dirLightDirections[index] = -visibleLight.localToWorldMatrix.GetColumn(2);
     dirLightShadowData[index] = _shadows.ReserveDirectionalShadows(visibleLight.light, index);
 }
Ejemplo n.º 5
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="index">index in directional light</param>
    /// <param name="visibleIndex">index in all visible Light</param>
    /// <param name="visibleLight"></param>
    void SetupDirectionalLight(int index, int visibleIndex, ref VisibleLight visibleLight, Light light)
    {
        dirLightColors[index] = visibleLight.finalColor;
        Vector4 dirAndMask = -visibleLight.localToWorldMatrix.GetColumn(2);

        dirAndMask.w = light.renderingLayerMask.ReinterpretAsFloat();
        dirLightDirectionsAndMasks[index] = dirAndMask;
        dirLightShadowData[index]         =
            shadows.ReserveDirectionalShadows(light, visibleIndex);
    }
Ejemplo n.º 6
0
    private void SetupDirectionalLight(int index, int visibleIndex, ref VisibleLight visibleLight, Light light)
    {
        //Light light = RenderSettings.sun;
        //buffer.SetGlobalVector(dirLightColorId, light.color.linear * light.intensity);
        //buffer.SetGlobalVector(dirLightDirectionId, -light.transform.forward);

        dirLightColors[index] = visibleLight.finalColor;
        Vector4 dirAndMask = -visibleLight.localToWorldMatrix.GetColumn(2);

        dirAndMask.w = light.renderingLayerMask.ReinterpretAsFloat();
        dirLightDirectionsAndMasks[index] = dirAndMask;
        dirLightShadowData[index]         = shadows.ReserveDirectionalShadows(light, visibleIndex);
    }