• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About amigocz

  • Rank
  1. Hi is there any way how to share one depth buffer amont multiple swap chains using DX10? I know that common way how to obtain a back buffer is like this: ID3D10Texture2D* backBuffer; m_pSwapChain->GetBuffer(0, __uuidof(ID3D10Texture2D), reinterpret_cast<void**>(&backBuffer)); m_pD3dDevice->CreateRenderTargetView(backBuffer, 0, &m_pRenderTargetView); backBuffer->Release(); I've tried to fake it by creating the back buffer manually but with no success. So is there any hack or something? Thank you
  2. ID3D10ShaderReflection issue

    Ouch that was a stupid mistake, sorry for that..
  3. Hi, I've got trouble using the ID3D10ShaderReflection interface. This is a sample of my code: D3DX10CompileFromMemory( pData, fsize, NULL, NULL, NULL, _W2A(desc.EntryFunction.Get()), profile, flags, 0, NULL, &pShaderBlob, &pErrors, NULL ) g_pD3ddev->CreateVertexShader(pShaderBlob->GetBufferPointer(), pShaderBlob->GetBufferSize(), &m_pVS) D3D10ReflectShader(pShaderBlob->GetBufferPointer(), pShaderBlob->GetBufferSize(), &m_pReflection) D3D10_SHADER_DESC shDesc; m_pReflection->GetDesc(&shDesc); And the description looks like this: Version 65600 unsigned int Creator 0x050b2160 "Microsoft (R) HLSL Shader Compiler 9.26.952.2844" const char * Flags 257 unsigned int ConstantBuffers 0 unsigned int BoundResources 0 unsigned int InputParameters 3 unsigned int OutputParameters 4 unsigned int InstructionCount 5 unsigned int TempRegisterCount 0 unsigned int TempArrayCount 0 unsigned int DefCount 0 unsigned int DclCount 6 unsigned int ...... And this is my shader: struct vsout { float4 position : POSITION; float2 texCoord : TEXCOORD0; float4 color : COLOR; float2 something : TEXCOORD1; }; cbuffer cbTest { float4x4 gWorld; float4x4 gWVP; float gTime; }; Texture2D tex; vsout vsmain2D(float3 position : POSITION, float2 texCoord : TEXCOORD0, float4 color : COLOR) { float ftime = gTime; vsout OUT; OUT.position = float4(position, 1); OUT.texCoord = texCoord; OUT.color = color; return OUT; } As you can see, it somehow ignores the defined cbuffer and I really don't know why. Thank you
  4. DX10 shaders without fx

    Thanks a lot again. It looks pretty clear now.
  5. DX10 shaders without fx

    Thanks a lot, that was very helpful. But let me ask few more questions. Lets say that I've got 2 vertex shaders and both of them contain the same cbuffer. Now Am I supposed to call the ID3D10Device::VSSetConstantBuffers everytime I change a vertex buffer or does it stay connected to a given slot? Does the ID3D10Device::VSSetConstantBuffers method discard all the previously connected cbuffers? Can I change the content of a buffer, which is currently connected to a vertex shader? Sorry for this questions, but I could not find any suitable information about this.
  6. Hi, I'm trying to implement HLSL shaders with DX10 without using the effect files. Correct me if I'm wrong but I thing that using the separate shaders is way more flexible and better to use in an advanced material system. There is the ID3D10VertexShader interface for vertex shaders but it does not have any methods itself. The ID3D10Device contains methods ID3D10Device::VSSetConstantBuffers and ID3D10Device::VSSetShaderResources but nothing for setting up the individual parameters. Is this a good way to store all the parameters in ID3D10Buffer objects and is there a way how to share a bound constant buffer among multiple shaders? Thank you
  7. OK I finally made it working. Thanks both of you. I had to setup the entire VSOut structure as an input parameter for PS. The DX10 version of Cg is still a bit crappy I guess.
  8. Hi I spent last 3 days trying to figure out what causes this error: D3D10: ERROR: ID3D10Device::Draw: Vertex Shader - Pixel Shader linkage error: Signatures between stages are incompatible. The reason is that Semantic 'TEXCOORD' is defined for mismatched hardware registers between the output stage and input stage. [ EXECUTION ERROR #343: DEVICE_SHADER_LINKAGE_REGISTERINDEX ] I'm using NVIDIA Cg for my shaders which is what I blame the most. But Cg translates the shader's code into HLSL and I haven't found any issue in that code. I've tried to debug a frame using the PerfHUD and everything seems to be fine as well. Another thing I blame for this is the geometry shader stage, but I'm not using any geometry shader yet. I would really appreciate any idea what might cause this error, thank you. here is my vertex and pixel shader translated into HLSL by Cg: http://p3d.ic.cz/primitive_renderer_vs2D.txt http://p3d.ic.cz/primitive_renderer_ps.txt
  9. OpenGL geometry shader output?

    Thanks a lot!
  10. Hi, Direct3D10 came out with a new feature called Stream-Output. What this feature does is, that you can copy the data from a geometry shader back to a vertex buffer. Do you have any information whether or not OpenGL support anything like this? Thank you.
  11. OpenGL GUI System Advice

    Quote:Original post by GM-Scribe Wouldn't constantly having to resize AKA remake the whole buffer as new gui objects are add/deleted be more of a performance hit? It definetly would. You can create a dynamic VBO that can fit lets say 1000 vertices. Than every time something changes (or just every frame) you just discard the entire VBO, map it, copy in the entire GUI geometry and unmap the VBO. I really do recommend you to create some PrimitiveRenderer class, which would handle the dynamic VBO and provide you methods like AddRect, AddLine, ... and use this class to render your GUI. Good luck
  12. OpenGL GUI System Advice

    I would recommend you to store all your GUI elements in one dynamic VBO since drawing a big chunks of geometry is more efficient.
  13. Radeon x1650 NPOT support?

    I used to have Radeon X1950Pro and it did not support NPOT textures as far as I remember. Maybe you could use a Rect texture, see http://www.opengl.org/wiki/NPOT_Textures .
  14. VBO locking is slow

    Thank you, this seems to be very helpful.
  15. VBO locking is slow

    Thank you for your answer. I was just trying to figure out, why is my engine's framerate two times slower when using OGL and found out that here is the "bug". 0.2ms for locking a vertex buffer is just too much time. I spent hours searching the Internet and various source codes, but it looks like I'm not doing anything wrong.
  • Advertisement