コード例 #1
0
ファイル: Lighting.cs プロジェクト: wjezxujian/CatlikeCoding
    private void SetupPointLight(int index, int visibleIndex, ref VisibleLight visibleLight)
    {
        otherLightColors[index] = visibleLight.finalColor;
        Vector4 position = visibleLight.localToWorldMatrix.GetColumn(3);

        position.w = 1f / Mathf.Max(visibleLight.range * visibleLight.range, 0.00001f);
        otherLightPositions[index]   = position;
        otherLightSpotAngles[index]  = new Vector4(0f, 1f);
        otherLightShadowDatas[index] = shadows.ReserveOtherShadows(visibleLight.light, visibleIndex);
    }
コード例 #2
0
ファイル: Lighting.cs プロジェクト: wjezxujian/CatlikeCoding
    private void SetupPointLight(int index, int visibleIndex, ref VisibleLight visibleLight, Light light)
    {
        otherLightColors[index] = visibleLight.finalColor;
        Vector4 position = visibleLight.localToWorldMatrix.GetColumn(3);

        position.w = 1f / Mathf.Max(visibleLight.range * visibleLight.range, 0.00001f);
        otherLightPositions[index]  = position;
        otherLightSpotAngles[index] = new Vector4(0f, 1f);

        Vector4 dirAndMask = Vector4.zero;

        dirAndMask.w = light.renderingLayerMask.ReinterpretAsFloat();
        otherLightDirectionsAndMasks[index] = dirAndMask;
        otherLightShadowData[index]         = shadows.ReserveOtherShadows(light, visibleIndex);
    }
コード例 #3
0
    void SetupPointLight(int index, int visibleIndex, ref VisibleLight visibleLight, Light light)
    {
        otherLightColors[index] = visibleLight.finalColor;
        Vector4 position = visibleLight.localToWorldMatrix.GetColumn(3);

        position.w = 1 / Mathf.Max(visibleLight.range * visibleLight.range, 0.000001f);
        otherLightPositions[index] = position;
        //dummy a and b for spot angle attenuation to make sure point light have no angle att
        otherLightSpotAngles[index] = new Vector4(0.0f, 1.0f);

        //need to assign dummy direction for modification of rendering mask
        Vector4 dirAndmask = Vector4.zero;

        dirAndmask.w = light.renderingLayerMask.ReinterpretAsFloat();
        otherLightDirectionsAndMasks[index] = dirAndmask;

        //Light light = visibleLight.light;
        otherLightShadowData[index] = shadows.ReserveOtherShadows(light, visibleIndex);
    }