public void Initialize(ResourceManager cache) { if (SideMaterials.Length >= 6) { sphere = cache.GetQuadSphere(48); defaultMaterial = cache.DefaultMaterial; ready = true; } }
public void Initialize(ResourceManager cache) { if (sideMaterialNames.Count >= 6) { sphere = new QuadSphere(48); defaultMaterial = cache.DefaultMaterial; ready = true; } }
public override QuadSphere GetQuadSphere(int slices) { QuadSphere sph; if (!quadSpheres.TryGetValue(slices, out sph)) { sph = new QuadSphere(slices); quadSpheres.Add(slices, sph); } return(sph); }
public CubemapViewer(string title, TextureCube texture, MainWindow mw) { Title = title; EnvMapTest.Compile(); shader = EnvMapTest.Get(); tex = texture; sphere = new QuadSphere(32); viewport = new Viewport3D(mw); viewport.DefaultOffset = new Vector3(0, 0, 4); viewport.ModelScale = 0.01f; viewport.Mode = CameraModes.Arcball; viewport.Background = new Vector4(0.12f, 0.12f, 0.12f, 1f); viewport.ResetControls(); cubemapIndex = shader.Shader.GetLocation("Cubemap"); shader.Shader.SetInteger(cubemapIndex, 0); cameraPositionIndex = shader.Shader.GetLocation("CameraPosition"); }