// -------------------------------------------------------------------- public override void Init(Onyx3DInstance onyx3d) { base.Init(onyx3d); GL.Enable(EnableCap.CullFace); GL.Enable(EnableCap.DepthTest); GL.Enable(EnableCap.Multisample); GL.Enable(EnableCap.LineSmooth); GL.Hint(HintTarget.LineSmoothHint, HintMode.Nicest); GL.Enable(EnableCap.Blend); GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha); GL.Enable(EnableCap.TextureCubeMapSeamless); GL.ClearColor(Color.SlateGray); Gizmos = new GizmosManager(); Gizmos.Init(onyx3d); mRenderFrame = new FrameBuffer((int)MainResolution.X, (int)MainResolution.Y); mScreenCamera = new OrthoCamera("Cam", 1, 1, 0, 1000); mScreenQuad = new ScreenQuadRenderer(); mScreenQuad.GenerateQuad(1, 1); mScreenQuad.Material = onyx3d.Resources.GetMaterial(BuiltInMaterial.Screen); }
public override void OnDrawGizmos(GizmosManager gizmos) { gizmos.DrawWireSphere(Transform.Position, 0.1f, Color.Xyz, 20); if (Type == LightType.Directional) { gizmos.DrawCircle(Transform.Position, 0.1f, Color.Xyz, Transform.Forward); gizmos.DrawLine(Transform.Position + Transform.Right * 0.1f, Transform.Position + Transform.Right * 0.1f + Transform.Forward, Color.Xyz); gizmos.DrawLine(Transform.Position - Transform.Right * 0.1f, Transform.Position - Transform.Right * 0.1f + Transform.Forward, Color.Xyz); gizmos.DrawLine(Transform.Position + Transform.Up * 0.1f, Transform.Position + Transform.Up * 0.1f + Transform.Forward, Color.Xyz); gizmos.DrawLine(Transform.Position - Transform.Up * 0.1f, Transform.Position - Transform.Up * 0.1f + Transform.Forward, Color.Xyz); } if (Type == LightType.Spot) { float endRadius = 0.5f; gizmos.DrawCircle(Transform.Position + Transform.Forward, endRadius, Color.Xyz, Transform.Forward); gizmos.DrawLine(Transform.Position, Transform.Position + Transform.Right * endRadius + Transform.Forward, Color.Xyz); gizmos.DrawLine(Transform.Position, Transform.Position - Transform.Right * endRadius + Transform.Forward, Color.Xyz); gizmos.DrawLine(Transform.Position, Transform.Position + Transform.Up * endRadius + Transform.Forward, Color.Xyz); gizmos.DrawLine(Transform.Position, Transform.Position - Transform.Up * endRadius + Transform.Forward, Color.Xyz); } }
// -------------------------------------------------------------------- public override void OnDrawGizmos(GizmosManager gizmos) { base.OnDrawGizmos(gizmos); gizmos.DrawMesh(Transform.ModelMatrix, Onyx3DEngine.Instance.Resources.GetMesh(BuiltInMesh.GizmoCamera), Onyx3DEngine.Instance.Resources.GetMaterial(BuiltInMaterial.Default)); }
// -------------------------------------------------------------------- public override void OnDrawGizmos(GizmosManager gizmos) { Matrix4 rts = Transform.ModelMatrix; rts[0, 0] = 0.25f; rts[1, 1] = 0.25f; rts[2, 2] = 0.25f; Material mat = Onyx3DEngine.Instance.Resources.GetMaterial(BuiltInMaterial.ReflectionProbe); CubemapMaterialProperty cubemapProp = mat.GetProperty <CubemapMaterialProperty>("cubemap"); cubemapProp.Data = mCubemap.Id; gizmos.DrawMesh(rts, Onyx3DEngine.Instance.Resources.GetMesh(BuiltInMesh.Sphere), mat); }
public override void Init(Onyx3DInstance onyx3d) { base.Init(onyx3d); GL.Enable(EnableCap.CullFace); GL.Enable(EnableCap.DepthTest); GL.Enable(EnableCap.Multisample); GL.Hint(HintTarget.MultisampleFilterHintNv, HintMode.Nicest); GL.Enable(EnableCap.LineSmooth); GL.Hint(HintTarget.LineSmoothHint, HintMode.Nicest); GL.Enable(EnableCap.Blend); GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); GL.ClearColor(Color.SlateGray); Gizmos = new GizmosManager(); Gizmos.Init(onyx3d); }
// -------------------------------------------------------------------- public virtual void OnDrawGizmos(GizmosManager gizmos) { }