Re: flickering skybox (newb question)



You are probably competing with windows forms repainting the control.

Off the top of my head you need to set the control style to include
AllPaintingInWMPaint

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformscontrolstylesclasstopic.asp


--
Zman (mailto:zman@xxxxxxxxxxxxxx)
http://www.thezbuffer.com
News and Resources for Managed DirectX


"Aaron Lovi" <AaronLovi@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C7042B9E-7D93-4CE3-8DC3-105E76019349@xxxxxxxxxxxxxxxx
> Hi, I'm using C# from Visual Studio 2003 and DX9 for this. Basically, I
> just
> created a skybox into a panel control on a windowed form, and I'm rotating
> it. The rotation is done by a timer that goes off every 50ms, and
> increases
> the "dblAngle". The problem is that there is a lot of flicker. (I hope
> I'm
> posting enough info. If not, please tell me what else to post!)
>
> ------------------------------------------
> Here is how I'm setting my presentParams:
>
> presentParams.Windowed=true;
> presentParams.SwapEffect = SwapEffect.Discard;
> presentParams.BackBufferFormat = Format.X8R8G8B8;
> presentParams.BackBufferHeight = this.Height;
> presentParams.BackBufferWidth = this.Width;
> presentParams.BackBufferCount = 3;
> presentParams.PresentationInterval = PresentInterval.Default;
> presentParams.EnableAutoDepthStencil = true;
> presentParams.AutoDepthStencilFormat = DepthFormat.D16;
> device = new Device(0, DeviceType.Hardware,
> this.panelMain, CreateFlags.HardwareVertexProcessing, presentParams);
> ------------------------------------
>
> Here is how I'm setting up my matrices:
>
> device.Transform.World = Matrix.Identity;
> // dblAngle is incremented by a timer going off every 50ms
> device.MultiplyTransform(TransformType.World, Matrix.RotationY(dblAngle));
>
> device.Transform.View = Matrix.LookAtLH( new Vector3( 0.0f, 0.0f, 0.0f ),
> new Vector3( 0.0f, 0.0f, 400.0f ), new Vector3( 0.0f, 1.0f, 0.0f ) );
>
> device.Transform.Projection = Matrix.PerspectiveFovLH((float)Math.PI/4.0f,
> (float)this.Width/(float)this.Height, 1.0f, 500.0f );
> ----------------------------------------------------------
>
> Here is my render:
> private void Render()
> {
> if (device == null) return;
>
> try
> {
> //Clear the backbuffer to a Green color
> device.Clear(ClearFlags.Target | ClearFlags.ZBuffer,
> System.Drawing.Color.Green, 1.0f, 0);
>
> //Begin the scene
> device.BeginScene();
> // Setup the world, view, and projection matrices
> SetupMatrices();
>
> device.VertexFormat = CustomVertex.PositionColored.Format;
>
> device.SetTexture(0, null);
> device.SetStreamSource(0, vbTerrain, 0);
> device.DrawPrimitives(PrimitiveType.TriangleList, 0, 2);
>
> // draw the skybox
> this.dxSkyBox.Render(device);
>
> //End the scene
> device.EndScene();
>
> device.Present();
> }
> catch (DeviceLostException)
> // etc.
>
>
> --
> Aaron Lovi,
> Poker Villain support
> support [at] pokervillain.com


.



Relevant Pages

  • Re: older games dont work
    ... the support of my work have it and will burn a CD to me. ... and any other tips to make this game works will be great. ... Windows 95 including but not limited to: ... to map a pedal as a control ...
    (microsoft.public.windowsxp.games)
  • Re: Listing of XP tools commands
    ... All files with a .cpl extension are normally invoked via the Control ... IP Configuration - ipconfi/all ... Logs You Out Of Windows - logoff... ... System File Checker Utility - sfc /revert ...
    (microsoft.public.windowsxp.general)
  • Re: Listing of XP tools commands
    ... All files with a .cpl extension are normally invoked via the Control ... IP Configuration - ipconfi/all ... Logs You Out Of Windows - logoff... ... System File Checker Utility - sfc /revert ...
    (microsoft.public.windowsxp.general)
  • Re: Listing of XP tools commands
    ... All files with a .cpl extension are normally invoked via the Control ... IP Configuration - ipconfi/all ... Logs You Out Of Windows - logoff... ... System File Checker Utility - sfc /revert ...
    (microsoft.public.windowsxp.general)
  • Re: Listing of XP tools commands
    ... [I found that page in a few seconds by Googling "run commands winxp", ... All files with a .cpl extension are normally invoked via the Control ... Logs You Out Of Windows - logoff... ... System File Checker Utility - sfc /revert ...
    (microsoft.public.windowsxp.general)