Jump to content

  • Log In with Google      Sign In   
  • Create Account

Medo3337

Member Since 24 Apr 2012
Offline Last Active Apr 29 2016 09:20 PM

Topics I've Started

Depth Problem In Release Mode

21 April 2016 - 07:59 AM

Hello,
 
Sometimes, when I run the EXE file in release mode, I either don't see the depth working at all (most common) or I see a depth problem as it appear in the screenshot:
Attached File  D Problem.png   881.01KB   0 downloads
 
I'm doing assert(SUCCEEDED(hr)) on HRESULT for D3D11 initialization functions
 
I don't have this problem in debug mode, and mostly I don't have this problem if I'm running release mode from visual studio, the problem mostly appear if I'm running the EXE directly from release folder.
 
I'm using C++ / D3D11
 
Anyone know what could be causing the problem or how do I debug that kind of problem?
 

Dark Area Darker and Bright Area Brighter

17 April 2016 - 06:52 AM

Hello Guys,

 

When I edit the texture in photo editing software to make the bright areas brighter and the dark areas darker, I get much better results with HDR, so I thought about doing it in pixel shader instead.

 

How do I write a pixel shader that makes the dark areas darker and bright areas brighter?

 

I'm using DX11 / C++ and rendering the scene in HDR.


Creating Box RigidBody From AABB

12 April 2016 - 03:30 PM

Hi Guys,

 

I have one entity which contains many static meshes, I'm trying to create a box RigidBody for each mesh using Bullet Physics (btBoxShape)

 

Here is how I calculate the AABB for each mesh:


D3DXVECTOR3 boxMin(FLT_MAX, FLT_MAX, FLT_MAX);
D3DXVECTOR3 boxMax(-FLT_MAX, -FLT_MAX, -FLT_MAX);

for(UINT i = 0; i < NumOfVertices; i++)
{
    D3DXVECTOR3 vertexPosition = vertices[i].position;
    // Transform to the entity space
    D3DXVec3TransformCoord(&vertexPosition, &vertexPosition, &Entity->WorldMatrix);

    D3DXVec3Minimize(&boxMin, &boxMin, &vertexPosition);
    D3DXVec3Maximize(&boxMax, &boxMax, &vertexPosition);
}

Then I create btBoxShape by using:

D3DXVECTOR3 boxHalfExtent = (boxMax - boxMin) * 0.5f;
btBoxShape* BoxShape = new btBoxShape(btVector3(boxHalfExtent.x, boxHalfExtent.y, boxHalfExtent.z));
// ...

 

For the box transform that I use to create the box, I multiply the mesh world matrix with the entity world matrix:

btTransform transform = ConvertWorldMatrixTobtTransform(MeshWorldMatrix * Entity->WorldMatrix);

Now, the problem is that when I debug draw the physics, I see the box is not adjusted correctly over the mesh, half of the box over the actual mesh and the other half is under the mesh (see the attached screenshot).

 

How do I get the box to appear correctly over the mesh?

 

Attached File  Box0.png   213.18KB   0 downloads


FPS Player

08 April 2016 - 10:24 AM

I have been trying to create FPS player (character) in Bullet Physics

 

I tried to use btKinematicCharacterController with capsule ghost object but the player fall through the ground.

 

Any idea how do I get the player to walk on the ground instead of falling through it?


Frame Independent Problem

07 April 2016 - 06:58 AM

Hi Guys,

 

I'm using QueryPerformanceCounter() to get the elapsed time in seconds in a float variable.

 

Then I multiply the elapsed time with the velocity as the following in entity Update(float timeElapsed) function:

void Update(float timeElapsed)
{
velocity *= timeElapsed;
setPosition(getPosition() + velocity); // Now, update the entity position based on velocity
velocity = D3DXVECTOR3(0.0f, 0.0f, 0.0f);
...
...

I can notice that the entity movement speed is not the same when the frame rate drop, for example If I enable VSync during rendering to drop the frame rate to 60, the entity move faster than when the frame rate is 130

 

Any idea what could be causing this problem?


PARTNERS