Jump to content
  • Advertisement

stale

Member
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral

About stale

  • Rank
    Newbie

Personal Information

  • Interests
    Programming
  1. wow, turns out my pixel shader was returning a float and not a float4. Changing it to float4 completely fixed the problem
  2. I tried running the program on my other computer (laptop with integrated gpu) and rendering the solid mesh, and the results are even worse. Could it be that I'm overworking the GPU somehow? I'm running at 100+ fps so this seems unlikely.
  3. I'm continuing to learn more about terrain rendering, and so far I've managed to load in a heightmap and render it as a tessellated wireframe (following Frank Luna's DX11 book). However, I'm getting some really weird behavior where a large section of the wireframe is being rendered with a yellow color, even though my pixel shader is hard coded to output white. The parts of the mesh that are discolored changes as well, as pictured below (mesh is being clipped by far plane). Here is my pixel shader. As mentioned, I simply hard code it to output white: float PS(DOUT pin) : SV_Target { return float4(1.0f, 1.0f, 1.0f, 1.0f); } I'm completely lost on what could be causing this, so any help in the right direction would be greatly appreciated. If I can help by providing more information please let me know.
  4. Thank you so much for the detailed post, I managed to fix the problem! I enabled the debug layer and took a look at the error messages: D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: Mismatched topology. Current Hull Shader expects input Control Point count of 4, but Input Assembler topology is not set to the matching PRIMITIVE_TOPOLOGY_*_PATCHLIST topology. Topology currently set to: PRIMITIVE_TOPOLOGY_TRANGLELIST [ EXECUTION ERROR #2097222: DEVICE_DRAW_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH] D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: Vertex Shader - Hull Shader linkage error: Signatures between stages are incompatible. Semantic 'POSITION' is defined for mismatched hardware registers between the output stage and input stage. [ EXECUTION ERROR #343: DEVICE_SHADER_LINKAGE_REGISTERINDEX] D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: Domain Shader - Pixel Shader linkage error: Signatures between stages are incompatible. The input stage requires Semantic/Index (POSITION,0) as input, but it is not provided by the output stage. [ EXECUTION ERROR #342: DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND] D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: Domain Shader - Pixel Shader linkage error: Signatures between stages are incompatible. The input stage requires Semantic/Index (NORMAL,0) as input, but it is not provided by the output stage. [ EXECUTION ERROR #342: DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND] D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: Domain Shader - Pixel Shader linkage error: Signatures between stages are incompatible. The input stage requires Semantic/Index (TEXCOORD,0) as input, but it is not provided by the output stage. [ EXECUTION ERROR #342: DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND] I knew something was immediately wrong since I use DrawIndexed to render a mesh, and that effect file doesn't use a domain shader. It turns out that I forget to unbind the Hull/Domain shader in my other effect files, which was causing the device to crash. All I had to do was do this (in all of other effect files) to fix the problem: SetVertexShader(CompileShader(vs_5_0, VS())); SetHullShader(NULL); SetDomainShader(NULL); SetGeometryShader(NULL); SetPixelShader(CompileShader(ps_5_0, PS()));
  5. I've just started learning about tessellation from Frank Luna's DX11 book. I'm getting some very weird behavior when I try to render a tessellated quad patch if I also render a mesh in the same frame. The tessellated quad patch renders just fine if it's the only thing I'm rendering. This is pictured below: ' However, when I attempt to render the same tessellated quad patch along with the other entities in the scene (which are simple triangle-lists), I get the following error: I have no idea why this is happening, and google searches have given me no leads at all. I use the following code to render the tessellated quad patch: ID3D11DeviceContext* dc = GetGFXDeviceContext(); dc->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST); dc->IASetInputLayout(ShaderManager::GetInstance()->m_JQuadTess->m_InputLayout); float blendFactors[] = { 0.0f, 0.0f, 0.0f, 0.0f }; // only used with D3D11_BLEND_BLEND_FACTOR dc->RSSetState(m_rasterizerStates[RSWIREFRAME]); dc->OMSetBlendState(m_blendStates[BSNOBLEND], blendFactors, 0xffffffff); dc->OMSetDepthStencilState(m_depthStencilStates[DSDEFAULT], 0); ID3DX11EffectTechnique* activeTech = ShaderManager::GetInstance()->m_JQuadTess->Tech; D3DX11_TECHNIQUE_DESC techDesc; activeTech->GetDesc(&techDesc); for (unsigned int p = 0; p < techDesc.Passes; p++) { TerrainVisual* terrainVisual = (TerrainVisual*)entity->m_VisualComponent; UINT stride = sizeof(TerrainVertex); UINT offset = 0; GetGFXDeviceContext()->IASetVertexBuffers(0, 1, &terrainVisual->m_VB, &stride, &offset); Vector3 eyePos = Vector3(cam->m_position); Matrix rotation = Matrix::CreateFromYawPitchRoll(entity->m_rotationEuler.x, entity->m_rotationEuler.y, entity->m_rotationEuler.z); Matrix model = rotation * Matrix::CreateTranslation(entity->m_position); Matrix view = cam->GetLookAtMatrix(); Matrix MVP = model * view * m_ProjectionMatrix; ShaderManager::GetInstance()->m_JQuadTess->SetEyePosW(eyePos); ShaderManager::GetInstance()->m_JQuadTess->SetWorld(model); ShaderManager::GetInstance()->m_JQuadTess->SetWorldViewProj(MVP); activeTech->GetPassByIndex(p)->Apply(0, GetGFXDeviceContext()); GetGFXDeviceContext()->Draw(4, 0); } dc->RSSetState(0); dc->OMSetBlendState(0, blendFactors, 0xffffffff); dc->OMSetDepthStencilState(0, 0); I draw my scene by looping through the list of entities and calling the associated draw method depending on the entity's "visual type": for (unsigned int i = 0; i < scene->GetEntityList()->size(); i++) { Entity* entity = scene->GetEntityList()->at(i); if (entity->m_VisualComponent->m_visualType == VisualType::MESH) DrawMeshEntity(entity, cam, sun, point); else if (entity->m_VisualComponent->m_visualType == VisualType::BILLBOARD) DrawBillboardEntity(entity, cam, sun, point); else if (entity->m_VisualComponent->m_visualType == VisualType::TERRAIN) DrawTerrainEntity(entity, cam); } HR(m_swapChain->Present(0, 0)); Any help/advice would be much appreciated!
  6. Assuming you have a list of vertices and a list of indices, and you know exactly which vertices in the list you'd like to remove, you can write a fairly simple algorithm to reconstruct your vertex/index lists. This can be done by using a map to map an index of your vertex list to an offset value which you'll use to correct the index list. First, loop through your vertex list and keep count of the current amount of vertices you've encountered that you'd like to remove. Whenever you hit a vertex that you don't want to remove, add an entry into the map which maps the current index (in the vertex list) to the current amount of vertices you've encountered so far that you want to remove. After you've done that, you can simple iterate over your index list and subtract the current value in the list by the value that you get from the map we made previously (using the current value in the index list as the key). This effectively "shifts" the indices over to correct for the vertices that you removed. There's probably a better way of doing this, but I think this should correct all of the indices that you have, and now all you have to do is actually remove all of the vertices you don't want (and the indices that reference them) and create new vertex/index buffers with this new data.
  • 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!