Jump to content

  • Log In with Google      Sign In   
  • Create Account


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

#5288088 Depth Problem In Release Mode

Posted by on 22 April 2016 - 12:46 AM

Okay, all the comments were helpful here.


With RenderDoc, I found a warning that the depth stencil buffer size is not the same as the render target view size, so I had to create a depth stencil view for each render target view based on it's size.


I also found that I have uninitialized variable m_depthEnabled


@Hodgman: I'm still trying to get RenderDoc to work, it's still crashing, please check out my above comment


@Krypt0n: Number 8 failed hence number 7 failed as well :D

#5285739 Frame Independent Problem

Posted by on 08 April 2016 - 01:36 AM

Now, it's clear that the problem is caused by the physics engine, since the movement is frame independent only if I disable the physics engine or if I don't assign the entity to the physics engine.


Here is what I'm doing in the physics engine each frame:

1. Iterate through all the body dynamics and update their transformation based on the entities transformation

2. Simulate physics using: m_DynamicsWorld->stepSimulation(elapsedTime);

3. Iterate through all the body dynamics and update the entities transformation based on the rigid bodies transformation.

#5280007 Random Vector Based On Cone Angle

Posted by on 07 March 2016 - 06:48 AM

@Nanoha:Here is what I'm doing:

void GenerateParticle()
Particle.Velocity = Velocity;
Particle.Velocity += GetRandVector() * velocityVar;
Particle.Velocity *= ParticleSpeed;
// ...

From the above code I get the particles moving as a cone shape, and if I increase velocityVar the cone angle will increase


How do I set velocityVar based on certain degree so I can determine the cone angle based on degree?

#5272346 Use different shaders

Posted by on 23 January 2016 - 06:16 AM

You can create a shader management class and then use a function inside the shader management class to load any shader you want and have a pointer stored for each loaded shader so you don't have to load it again.


The function will return that pointer if the shader was loaded before or load the shader if the shader was not loaded yet.

#5269287 Downsampling Problem

Posted by on 04 January 2016 - 05:29 PM



I was setting the view port in initialization instead of rendering.

#5204283 Rendering .obj Model in DirectX 11

Posted by on 14 January 2015 - 02:08 PM

@braindigitalis: What If I don't know where the problem is?


The only thing I see is that dev->CreateBuffer() is returning false when creating vertex or index buffer even both buffers was created successfully.


However, I'm not sure if the box is drawn or not (I see nothing on the screening)

int indexCount = vertexCount;
// Create vertex buffer
ZeroMemory(&bd, sizeof(D3D11_BUFFER_DESC));
bd.Usage = D3D11_USAGE_DYNAMIC;
bd.BindFlags = D3D11_BIND_VERTEX_BUFFER;
bd.ByteWidth = vertexCount * sizeof(VertexType);
bd.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
bool r = dev->CreateBuffer(&bd, NULL, &pVertexBuffer);

devcon->Map(pVertexBuffer, NULL, D3D11_MAP_WRITE_DISCARD, 0, &ms);
memcpy(ms.pData, &vertices, sizeof(vertices));
devcon->Unmap(pVertexBuffer, NULL);

// Create index buffer
D3D11_BUFFER_DESC indexBufferDESC;
//ZeroMemory(&indexBufferDESC, sizeof(indexBufferDESC));
indexBufferDESC.Usage = D3D11_USAGE_DEFAULT;
indexBufferDESC.ByteWidth = sizeof(unsigned long) * indexCount;
indexBufferDESC.BindFlags = D3D11_BIND_INDEX_BUFFER;
indexBufferDESC.CPUAccessFlags = 0;
indexBufferDESC.MiscFlags = 0;
indexBufferDESC.StructureByteStride = 0;

indexData.pSysMem = indices;
indexData.SysMemPitch = 0;
indexData.SysMemSlicePitch = 0;

// Create the index buffer
result = dev->CreateBuffer(&indexBufferDESC, &indexData, &pIndexBuffer);

#5204276 Rendering .obj Model in DirectX 11

Posted by on 14 January 2015 - 01:32 PM

@Aardvajk: The problem is: I don't see the model on the screen even I'm loading the vertices and setting up the vertex and index buffer


So, the best thing here is to post the code that I'm using.


FYI: This is just a simple project and it won't take 5 minutes to look it up.


Do you think someone is going to download your project, set it up on their system, investigate and fix the issue then send back the fixed project, all from the goodness of their hearts?



Yes, I'm expecting people here will help.

#5204263 Rendering .obj Model in DirectX 11

Posted by on 14 January 2015 - 12:44 PM

@fastcall22: What do you mean?

#5204249 Rendering .obj Model in DirectX 11

Posted by on 14 January 2015 - 11:50 AM



I'm trying to render a box model (.obj file) but I don't see anything, I have attached the project file.

Attached Files

#5160387 Most Efficient Way for Lighting in Forward Rendering

Posted by on 13 June 2014 - 05:49 PM

I'm currently using Forward Lighting and trying to do my best to make sure that the FPS game will always render all the lights


1. In Pixel Shader 2.0, I have

DirectionalLight dirLights[maxLights];
PointLight pointLights[maxLights];
SpotLight spotLights[maxLights];

What is the appropriate number for the variable maxLights?


2. Since Forward Lighting is limited to a certain amount of lights, I have been thinking that I could:

- Detect collision between the light and the camera bounding frustum and only render the light if the camera can see it

- Arrange the lights from closest to farthest to the camera and remove any light if it's index is over 'maxLights' variable


What do you think about my idea? What is the most efficient way to work with forward lighting?

#5110486 Shadows Problem

Posted by on 19 November 2013 - 09:43 AM

@belfegor: Since I'm bored, I wrote the code like that


But anyway that's not the point, the point is that shadows doesn't work correctly

#5107606 Computing view matrix to create shadow map

Posted by on 07 November 2013 - 12:05 AM

I'm trying to generate shadow map so I can pass it to the shader and create shadow


I have bunches of lights (including directional lights, point lights and spot lights)


How do I calculate the view matrix to create the shadow map?

#5097736 Rendering only what the camera see

Posted by on 29 September 2013 - 11:33 PM

For getting higher performance, is there is anyway to render ONLY what the camera see?
Since it's not really important to render anything that the camera can't see

#5092469 Skybox VS Skysphere

Posted by on 08 September 2013 - 07:22 AM

What is most used commonly in modern FPS games?


Can I use cube map on skysphere?


Some sky textures looks very good on the texture but when I try to apply it to the sky sphere it doesn't look as good as it was, that's why I'm thinking that I could use cube map.

#5092375 Skybox VS Skysphere

Posted by on 07 September 2013 - 07:31 PM

Hi guys,


What's your recommendations? Should I use sky box or sky sphere?


If I used sky sphere, should I apply cube texture to the sphere or just a single texture?


What is more commonly used especially in FPS games? Which one can produce better sky and which is easier for producing different looking skies?