Beispiel #1
0
        public ConservativeTester(LightSpaceTransformer transformer, int width, int height)
        {
            ColorSamples = new ColorTexture2D(width, height);
            GL.BindImageTexture(3, ColorSamples.TextureId, 0, false, 0, TextureAccess.ReadWrite, ColorSamples.InternalFormat());

            SampleShader.SetMatrix4("lightTransform", transformer.LightTransform);
        }
Beispiel #2
0
        public IZBRenderer(List <Mesh> scene, Camera defaultCam)
        {
            Scene      = scene;
            DefaultCam = defaultCam;
            LightDir   = new Vector3(-1, -1, -1).Normalized();

            PosSampler    = new FragPosSampler(scene, defaultCam);
            LSTransformer = new LightSpaceTransformer(scene, PosSampler, LightDir);
            Binner        = new LightSpaceBinner(defaultCam.Width, defaultCam.Height);
            ConTester     = new ConservativeTester(LSTransformer, defaultCam.Width, defaultCam.Height);
        }