Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 21 Jun 2012
Offline Last Active Feb 28 2013 02:23 PM

Posts I've Made

In Topic: Multiple viewports and shadow maps -- overwriting or not initialised properly?

14 January 2013 - 04:22 PM

Sure here are the arguments

HRESULT surfacegraph::Initialise(int nperRow, // data points per row if square grid data to be supplied
int left, int top, int width, int height, float fscale, D3DXVECTOR3 in_Eye,
bool Polar = 0, 
int number_in_outermost = 0, // data points in outermost circle if radially distributed data
int number_circles = 0,    // number of circles              if radially distributed data
float radius_outermost = 0.0f    //  max radius              if radially distributed data



The viewport coordinates are left,top,width,height. (And it's not radially distributed data). The calls to Initialise are in the top code box above. So yes, they are a bit overlapping. I think that should be OK though... the rendering of each object is meant to be independent.

In Topic: Texturing artifact of some kinds

25 July 2012 - 03:57 PM

D24S8 did it. Awesomeness.

The near value is 1.0f whereas my camera is at e.g. (3.5,5,-6) and the corner of the graph is at (3,,-3). I may well end up entering a formula for the near clipping frame value, because I might yet mess around with the camera position. But with 24-bit z buffer it does work fine anyway.



This work helps to bring about focus fusion as a viable energy source.

In Topic: Texturing artifact of some kinds

23 July 2012 - 04:18 PM

OK it definitely is z-fighting because I try SetRenderState( D3DRS_ZFUNC, D3DCMP_LESS ) and different bits go wrong.

I made another improvement by moving the far clipping frame from 5000.0f to 12.0f -- thanks for that.

It's still not perfect. Posted Image

I tried to force a 32 bit depth buffer ...
d3dpp.EnableAutoDepthStencil = TRUE;
d3dpp.AutoDepthStencilFormat = D3DFMT_D32;
... but CreateDevice then failed.
But maybe this is likely to work if I just make it run fullscreen? I'd rather run windowed if I can do, but if needs must.

"1. render far outer surface .. 2 render far inner surface ... 3 render near inner surface ... 4 render near outer surface"
In general the data is not as simple as here, so I can't predict what areas have a particular depth.

"* if you are using a 16 bit depth texture, increase it to 32 or 64 bit depth."
It's 32-bit R8G8B8X8. I don't understand why the texture would make a difference though?

"* increase the thickness to reduce z-fighting"
I can't do it.

Seems quite strange that it insists on 16bit although the z coordinates of vertices are float ? I'm sure if I could get it to just stick to 32 bit instead of casting to 16 when it projects, it would be fine. And that seems like it must be the key to it, I don't think 65536 depth values is going to be enough.

What happens if I set
d3dpp.EnableAutoDepthStencil = FALSE;
--I have to manage my own z-buffering? It sounds like too much of a challenge? Posted Image

In Topic: Texturing artifact of some kinds

23 July 2012 - 11:48 AM

Thank you both.
I had it set to not culling.
If I set
pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CW);
then nothing happens, the mesh is not rendered
If I set
pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW);
then it's a significant improvement:

I will look into the z-fighting and probably post again...

In Topic: Fixed function and shader not doing same thing?

22 June 2012 - 05:42 AM

Thank you v much for responses.

I now established that the error was in the eye of the beholder - the two things aren't meant to touch, they are at different y-coordinates. The axes are in the right place.

My first query and it was unintentionally a windup.

Now I just have to work out how to make text appear at device coordinates instead of screen coordinates.