Jump to content

  • Log In with Google      Sign In   
  • Create Account


mind in a box

Member Since 20 Apr 2010
Online Last Active Today, 03:13 AM
*****

Topics I've Started

Shouldn't the depth-test stop occluded pixels from being shaded?

10 December 2013 - 08:22 AM

Hi!

 

From what I know, the GPU shouldn't run a pixel shader for a pixel which already failed the depth-test, right?

 

We're developing a mobile game for WindowsPhone8 at the moment, using Direct3D11. To save some performance we created some geometry which we render behind the planes of our HUD, to not waste shading power to the pixels which will get occluded by our hud at the end anyways.

 

So what we are basically doing is the following:

  • Render HUD-Masks
  • Render World
  • Render HUD

When disabling the HUD we can see indeed that the pixels would not get into our backbuffer, but even when I let the Masks occlude the whole screen, we do not see any improvement of performance, which should be the case because reducing the resolution drastically improves it. So since we are pixelshader-bound like it seems, why isn't there any improvement? Did we maybe just miss some flag which disables depth-culling?

Or is this just unsupported on mobile GPUs?

 

Thanks in advance.


Angular velocity in direction of linear velocity

06 November 2013 - 01:39 PM

Hi there!

My situation is the following:

I have a ball, which I can give a kick. When it hits one of of the reflectors in our world I would like it to bounce off at the exact angle it came in. This is working pretty fine so far, but there is the problem of angular velocity.

After the ball hits a reflector it sometimes starts spinning and changes its direction. Therefore I could just set the angular velocity after hitting a reflector to zero, but since this stops the spinning completely it looks very unrealistic.

What I'm looking for now, is a solution of how to get the ball to spin into the exact direction it is reflected to.

Has someone maybe done something similar or just knows what do do here?

Help would be very appreciated. icon_smile.gif


Too many Zobrist-Numbers

25 April 2012 - 10:53 AM

Hi GDNet!

I was writing some Alpha-Beta-Search for a game and came to the point where I thought a transposition-table could be helpful.
The problem is not that I don't know how those are working, but more that the table of random numbers I need to generate the hash-values will get too big!

When I got it right I would have to initialize this array with random numbers to save my whole "battlefield":
__int64 ZobristNumbers	[2] // [Turncolor (Player/Enemy)]
							[20*5] // [Location]
							[20] // [NumPlayerPoints (Max 20)]
							[20] // [NumEnemyPoints (Max 20)]
							[2] // [PlaceOwner]
							[4][5] // [PlayerCards]
							[4][5]; // [EnemyCards]

So:
2*20*5*20*20*2*4*5*4*5 = 64000000
64000000 * 64bit = 4096000000 bytes = 4000000kbyte = 3906,25mbyte

And almost 4GB of memory are just too much. Is there any help for me or should I just drop the transposition-tables?

Regards,
Mind in a box

[Bullet]Fast objects crashing through my level bounds

11 December 2011 - 06:43 AM

Since working on the physics for the ships of our game Pulsedrive I've always had this issue bogging me.
I'm not working with bullet for a long time yet, so I probably don't know if I just have done something stupid in the setup of the engine.
Also I already asked this on the BulletPhysicsforums last month, but haven't got an answer yet.

To get you a better overview of the situation I made a little picture:
Posted Image

Most of the time the ship will just crash through the border marked with the red arrow when I am "fast" enough. This will also happen if I jump off a ramp and do a hard landing afterwards. I will just smash through the ground.
Ship uses a btBoxShape, track-pieces are btBvhTriangleMeshShapes. From my tests it doesn't seem that the ship crashes through a static box shape, so the problem must be the btBvhTriangleMeshShape.

Anyone knows a solution to this?

Jumpy raycast-vehicle

18 November 2011 - 08:53 AM

I'm currently trying to get the ships for our game Pulsedrive to hover. For this I'm using a raycast-vehicle-style function which shoots a ray for each of the 4 corners to the bottom to calculate the forces.
That works quite well so far, the problem is just that my ships won't stop to jump up and down.

I read something about the Damping, and even implemented it into the code, but it doesn't seem to help. I used this page as a reference:
http://www.digitalrune.com/Support/Blog/tabid/719/EntryId/91/Car-Physics-for-3D-Games.aspx

The function for calculating the rays goes like this:

	float DoRaycastPhysics(float PrevCompression, vector3 Point, float DeltaTime)
	{
		const float SHIP_SUSPENSION_STIFFNESS = 20.0f;
		const float SHIP_DAMPING = 0.15f;

		vector3 Pos = Ship.GetLocation();
		vector3 Susp = Ship.TransformDirection(Point); // Rotate wheel location

		float Susp_Length = 2.0; // Rest length
		float TireRad = 2.0f; // Tire radius

		vector3 RayOrigin = Pos + Susp;
		float RayLength = Susp_Length + TireRad;
		
		// Shoot the ray
		vector3 Nrm;
		float Dist = World.TraceEx(RayOrigin, vector3(0,-1,0), 1000, Nrm);
		vector3 HitPos = (vector3(0,-1,0)*Dist); // Local

		float Compression;
		if(Dist < RayLength)
		{
			Compression = Dist - TireRad; // Ray hit something, calculate the Compression
		}else
		{
			Compression = Susp_Length; // Didn't hit, set the compression to "rested"-state
		}

		// Calculate the SuspensionForce --- (Problem here?)
		float SuspensionForce =  SHIP_SUSPENSION_STIFFNESS * (Susp_Length - Compression) + SHIP_DAMPING * (PrevCompression - Compression) * DeltaTime;
		
		// Apply the force from the hit location in local space
		Ship.ApplyForce(vector3(0,SuspensionForce,0), HitPos);

		return Compression;
	}

Does anyone see what my problem could be?

PARTNERS