private void ParseLight(
            GameObject[] roots,
            ref SceneParseResult sceneParseResult)
        {
            var lights = GetAllLights(roots);

            if (!IsAllLightsDirty(lights))
            {
                // All the lights are unchange, no need to rebuild
                return;
            }

            sceneParseResult.ClearAllLights();

            foreach (var light in lights)
            {
                if (light.gameObject.activeInHierarchy)
                {
                    sceneParseResult.AddLight(light.GetLightInfo());
                }
            }

            // // Placeholder for scene parsing
            // sceneParseResult.AddLight(new RTLightInfo(
            //     position: new Vector3(1, 1, 1),
            //     rotation: new Vector3(0, 0, -1),
            //     type: 0
            // ));

            // sceneParseResult.AddLight(new RTLightInfo(
            //     position: new Vector3(0, 0, 0),
            //     rotation: new Vector3(0, 0, 0),
            //     type: 1
            // ));
        }
Exemple #2
0
        private void ParseLight(ref SceneParseResult sceneParseResult)
        {
            sceneParseResult.ClearAllLights();

            // Placeholder for scene parsing
            sceneParseResult.AddLight(new RTLightInfo(
                                          instance: 0,
                                          position: new Vector3(1, 1, 1),
                                          rotation: new Vector3(0, 0, -1),
                                          type: 0
                                          ));

            sceneParseResult.AddLight(new RTLightInfo(
                                          instance: 0,
                                          position: new Vector3(0, 0, 0),
                                          rotation: new Vector3(0, 0, 0),
                                          type: 1
                                          ));
        }