Jump to content
  • Advertisement

Bruno Greco

  • Content Count

  • Joined

  • Last visited

Community Reputation

121 Neutral

About Bruno Greco

  • Rank
  1. Bruno Greco

    Render Loop Problems DX10, C++

      I did, only after that, I decided to implement my component interface management system. If you're sure that the camera update is causing the problem, I sugest you to check: 1- Are all Camera members initialized correctly? 2- Are you setting all the members required for the calculations correctly from outside the class? 3- If it's working before you do the calculations on the update method, how are the matrices needed for rendering calculated before you actually run the update method? Just a side question, are you completely sure on how you calculate the câmera matrices? That movement you're using, is it movement from the object or from the câmera? It should be from the câmera. Also, are you setting the rotations to radians before calling MMatrixRotationRollPitchYaw()?
  2. Bruno Greco

    Render Loop Problems DX10, C++

    What compiler are you using? If it's visual studio you could use the graphical debugger and check each stage of the pipeline to see whats it trying to render. Also, have you gotten your Project to render a cube correctly yet? or is this your first try? If you already have succeeded before what features have you added after the correct renderization started to fail?   Despite I'm not really sure about this, I will guess that you are forgetting to reinitialize(casting again to identity) some matrix in your matrix calculations, making the calculations to acumulate wrong results. My tip here is that you should never run a complex Project before testing each basic part, because if you don't, and test only when you have a lot of features on, things get complicated.
  3. Bruno Greco

    DirectX Structured Buffer problem

    Oh my god I solved it. I can't believe it. I was using a com smart pointer for the srv. I noticed that when I called setShaderResource on the object, the pointer would be set to 0. Then I just made it a common native pointer and the problem was solved. Don't know what caused the COM pointer to be reset, maybe some crazy bug but, it doesn't matter.   Damn you Microsoft. It lay traps everywhere. Edit:   Wow, I was actually quite stupid. I just read the comPtr class docs and if you use the operator & on the object to get the pointer, it releases the object. Gotta be careful.
  4. Bruno Greco

    DirectX Structured Buffer problem

    The same place where it says that threads have stop running and compile successfull ad stuff like that? Because there I see no debug output.
  5. Bruno Greco

    DirectX Structured Buffer problem

      Sorry now I see that I missunderstood about the debug layer... I'm trying to use it now but I can't find the output anywhere. Where can I find the debug layer output?
  6. Bruno Greco

    DirectX Structured Buffer problem

    I have used the visual studio graphical debugger and checked the geometry shader pipeline stage that is the one I'm trying to bind the buffer to, and in the resource slot list all slots were empty. Thanks for the code tag, it's my first time in this forum. The behavior that I'm experiencing is that for any index that I try to retrieve data from the buffer it gives me 0, wich is the defined behavior for trying to access HLSL non-initialized data. And yeah, I have the debug layer on. All the function calls about the buffer CPU side returns OK values. Also, I set the whole buffer to the value '1' for testing purposes. Still, trying to access the buffer aways return zeroes.
  7. Hi, I'm trying to make a game using directx but I'm finding some problems when trying to bind a structured buffer resource to my Geometry Shader. It simply won't even bother to bind the resource to a shader resource slot, despite it being created succefuly. I'm creating the buffer like this:   D3D11_BUFFER_DESC descGPUBuffer;   ZeroMemory(&descGPUBuffer, sizeof(descGPUBuffer)); descGPUBuffer.BindFlags = D3D11_BIND_SHADER_RESOURCE; descGPUBuffer.ByteWidth = vertexNum *   sizeof(UINT); descGPUBuffer.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; descGPUBuffer.StructureByteStride = sizeof(UINT);     UINT* colorIndices = new UINT[vertexNum];     ZeroMemory(colorIndices, vertexNum * sizeof(UINT));     for(int x = 0;x < vertexNum;x++) {     colorIndices[x] = 1; }     D3D11_SUBRESOURCE_DATA colorData;     ZeroMemory(&colorData, sizeof(colorData)); colorData.pSysMem = colorIndices; dev->CreateBuffer(&descGPUBuffer, &colorData, &colorBuffer);     D3D11_BUFFER_DESC descBuf;     ZeroMemory( &descBuf, sizeof(descBuf) ); colorBuffer->GetDesc( &descBuf );     D3D11_SHADER_RESOURCE_VIEW_DESC descSRV;     ZeroMemory( &descSRV, sizeof(descSRV) ); descSRV.ViewDimension =   D3D11_SRV_DIMENSION_BUFFEREX; descSRV.BufferEx.FirstElement = 0; descSRV.Format =   DXGI_FORMAT_UNKNOWN; descSRV.BufferEx.NumElements = descBuf.ByteWidth / descBuf.StructureByteStride; dev->CreateShaderResourceView(colorBuffer.Get(), &descSRV, &colorSRV);     devcon->GSSetShaderResources(0, 1, &colorSRV); and my shader where the structured buffer is declared is like this:   StructuredBuffer<uint> BufferColors: register(t0);   GSOutput calcVertex(float4 position, float3 normal) {     GSOutput vertex;         float4 worldPosition;     vertex.position = mul(final, position);     vertex.normal = normal;     worldPosition = mul(position, world);     vertex.viewDirection = cameraPosition.xyz - worldPosition.xyz;     vertex.viewDirection = normalize(vertex.viewDirection);     return vertex; }     [maxvertexcount(24)] void main(point float4 input_point[1] : SV_POSITION, uint primID : SV_PrimitiveID, inout TriangleStream< GSOutput > output) etc... Can you guys please help me? I'm desperate I can't really find the error
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!