Jump to content
  • Advertisement

isu diss

Member
  • Content count

    54
  • Joined

  • Last visited

Community Reputation

-1 Poor

1 Follower

About isu diss

  • Rank
    Member

Personal Information

  • Industry Role
    Programmer
  • Interests
    Art
    Programming

Recent Profile Visitors

1847 profile views
  1. isu diss

    Gap between Sky and Terrain

    I want my terrain to look like in Far Cry 5, large terrain. No matter how much I scale the terrain, it can't cover the gap. That's because I disable depth buffer writes. @Cat's macheteHow can I stretch the sky? It's a dome, you mean extend the dome? Any help?
  2. How do I fill the gap between sky and terrain? Scaling the terrain or procedural terrain rendering?
  3. isu diss

    Light Shafts

    pls help me
  4. isu diss

    Light Shafts

    As my shadow map generation for tessellated terrain failed, I decided to implement this (https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch13.html) as my last try. Can anyone help me (the steps) to implement that in D3D11? Pls...
  5. I'm following rastertek tutorial 14 (http://rastertek.com/tertut14.html). The problem is, slope based texturing doesn't work in my application. There are plenty of slopes in my terrain. None of them get slope color. float4 PSMAIN(DS_OUTPUT Input) : SV_Target { float4 grassColor; float4 slopeColor; float4 rockColor; float slope; float blendAmount; float4 textureColor; grassColor = txTerGrassy.Sample(SSTerrain, Input.TextureCoords); slopeColor = txTerMossRocky.Sample(SSTerrain, Input.TextureCoords); rockColor = txTerRocky.Sample(SSTerrain, Input.TextureCoords); // Calculate the slope of this point. slope = (1.0f - Input.LSNormal.y); if(slope < 0.2) { blendAmount = slope / 0.2f; textureColor = lerp(grassColor, slopeColor, blendAmount); } if((slope < 0.7) && (slope >= 0.2f)) { blendAmount = (slope - 0.2f) * (1.0f / (0.7f - 0.2f)); textureColor = lerp(slopeColor, rockColor, blendAmount); } if(slope >= 0.7) { textureColor = rockColor; } return float4(textureColor.rgb, 1); } Can anyone help me? Thanks.
  6. isu diss

    Light Shafts

    2nd paper is based on my choice, "Real-time Volumetric Lighting in Participating Media". @Vilem Otte Can you help me on this, sir? Cos you explain things very clearly. I really appreciate anything you have to say.
  7. isu diss

    DX11 Light Shafts

    I decided to implement light shafts using http://sirkan.iit.bme.hu/~szirmay/lightshaft_link.htm So far I've only managed to implement the shadow map. Can anyone help me to implement this in D3D11? (I mean steps, I can do the rest). I'm new to all these shadow maps and etc.
  8. isu diss

    Terrain Rendering

    @Vilem OtteI'm waiting for your answer sir
  9. isu diss

    Terrain Rendering

    You've got a point there. But if I use the same render target for both skydome and terrain and snowy texture is used for terrain, downsampling stage(where bright spot is generated) also causes lens flare off the terrain. That's why I separated them.
  10. I added terrain rendering to my sky+lensflare rendering pipeline. I render terrain onto a render-target and bind it to the backbuffer as a texture. I do this in pixel shader of the fullscreen quad. return txTerrain.Sample(samLinear, Input.TextureCoords)+ txSkyDome.Sample(samLinear, Input.TextureCoords) + float4(LensFlareHalo * txDirty.Sample(samLinear, Input.TextureCoords).rgb * Intensity, 1); The problem is, the terrain is blended with sky. How do I fix this? pImmediateContext->OMSetDepthStencilState(pDSState_DD, 1); //disable depth buffer // render sky dome pImmediateContext->OMSetRenderTargets(1, &pSkyDomeRTV, pDepthStencilView); pImmediateContext->ClearRenderTargetView(pSkyDomeRTV, Colors::Black); pImmediateContext->ClearDepthStencilView(pDepthStencilView, D3D11_CLEAR_DEPTH, 1.0f, 0); //creating the sky texture in the cs shader float Theta = .2f;//XM_PI*(float)tElapsed/50; float Phi = XM_PIDIV4; CSCONSTANTBUF cscb; cscb.vSun = XMFLOAT3(cos(Theta)*cos(Phi), sin(Theta), cos(Theta)*sin(Phi)); cscb.MieCoeffs = XMFLOAT3((float)MieCoefficient(m, AerosolRadius, 680), (float)MieCoefficient(m, AerosolRadius, 530), (float)MieCoefficient(m, AerosolRadius, 470)); cscb.RayleighCoeffs = XMFLOAT3((float)RayleighCoefficient(680), (float)RayleighCoefficient(530), (float)RayleighCoefficient(470)); cscb.fHeight = 10; cscb.fWeight = 10; cscb.fWeight2 = 10; pImmediateContext->UpdateSubresource( pCSConstBuffer, 0, NULL, &cscb, 0, 0 ); UINT UAVCounts = 0; pImmediateContext->CSSetUnorderedAccessViews(0, 1, &pSkyUAV, &UAVCounts); pImmediateContext->CSSetConstantBuffers(0, 1, &pCSConstBuffer); pImmediateContext->CSSetShader(pComputeShader, NULL, 0); pImmediateContext->Dispatch(8, 8, 1); pImmediateContext->CSSetUnorderedAccessViews(0, 1, &NULLUAV, 0); pImmediateContext->CSSetShader(NULL, NULL, 0); //setting dome relevant vs and ps stuff pImmediateContext->IASetInputLayout(pVtxLayout); uiStride = sizeof(VTX); pImmediateContext->IASetVertexBuffers(0, 1, &pVtxSkyBuffer, &uiStride, &uiOffset); pImmediateContext->IASetIndexBuffer(pIndxSkyBuffer, DXGI_FORMAT_R32_UINT, 0); pImmediateContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); pImmediateContext->VSSetConstantBuffers(0, 1, &pVSSkyConstBuffer); pImmediateContext->VSSetShader(pVtxSkyShader, NULL, 0); pImmediateContext->PSSetShader(pPixlSkyShader, NULL, 0); pImmediateContext->PSSetShaderResources(0, 1, &pSkySRV); pImmediateContext->PSSetSamplers(0, 1, &SampState); mgWorld = XMMatrixTranslation(MyCAM->GetEye().m128_f32[0], MyCAM->GetEye().m128_f32[1], MyCAM->GetEye().m128_f32[2]); //drawing the sky dome VSCONSTANTBUF cb; cb.mWorld = XMMatrixTranspose( mgWorld ); cb.mView = XMMatrixTranspose( mgView ); cb.mProjection = XMMatrixTranspose( mgProjection ); pImmediateContext->UpdateSubresource( pVSSkyConstBuffer, 0, NULL, &cb, 0, 0 ); pImmediateContext->DrawIndexed((UINT)MyFBX->myInds.size(),0, 0); pImmediateContext->VSSetShader(0, NULL, 0); pImmediateContext->PSSetShader(0, NULL, 0); pImmediateContext->OMSetDepthStencilState(pDSState_DE, 1); //enable depth buffer // terrain rendering pImmediateContext->OMSetRenderTargets(1, &pTerRTV, pDepthStencilView); pImmediateContext->ClearRenderTargetView(pTerRTV, Colors::Black); pImmediateContext->ClearDepthStencilView(pDepthStencilView, D3D11_CLEAR_DEPTH, 1.0f, 0); mgWorld = XMMatrixIdentity();// XMMatrixRotationY( (float)tElapsed ); VSCONSTANTBUF tcb; tcb.mWorld = XMMatrixTranspose( mgWorld ); tcb.mView = XMMatrixTranspose( mgView ); tcb.mProjection = XMMatrixTranspose( mgProjection ); pImmediateContext->UpdateSubresource( pVSTerrainConstBuffer, 0, NULL, &tcb, 0, 0 ); //setting terain relevant vs and ps stuff pImmediateContext->IASetInputLayout(pVtxTerrainLayout); uiStride = sizeof(TERVTX); pImmediateContext->IASetVertexBuffers(2, 1, &pVtxTerrainBuffer, &uiStride, &uiOffset); pImmediateContext->IASetIndexBuffer(pIndxTerrainBuffer, DXGI_FORMAT_R32_UINT, 0); pImmediateContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); pImmediateContext->VSSetConstantBuffers(0, 1, &pVSTerrainConstBuffer); pImmediateContext->VSSetShader(pVtxTerrainShader, NULL, 0); pImmediateContext->PSSetShader(pPixlTerrainShader, NULL, 0); pImmediateContext->PSSetShaderResources(0, 1, &pTerrainSRV); pImmediateContext->PSSetSamplers(0, 1, &TerrainSampState); pImmediateContext->DrawIndexed((UINT)MyTerrain->myInds.size(), 0, 0); pImmediateContext->VSSetShader(0, NULL, 0); pImmediateContext->PSSetShader(0, NULL, 0); //downsampling stage for lens flare pImmediateContext->OMSetRenderTargets(1, &pSkyDomeBlurRTV, pDepthStencilView); pImmediateContext->ClearRenderTargetView(pSkyDomeBlurRTV, Colors::Black); pImmediateContext->ClearDepthStencilView(pDepthStencilView, D3D11_CLEAR_DEPTH, 1.0f, 0); uiStride = sizeof(VTX); pImmediateContext->IASetInputLayout(pVtxCamLayout); pImmediateContext->IASetVertexBuffers(1, 1, &pVtxCamBuffer, &uiStride, &uiOffset); pImmediateContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); pImmediateContext->VSSetShader(pVtxSkyBlurShader, NULL, 0); pImmediateContext->PSSetShader(pPixlSkyBlurShader, NULL, 0); pImmediateContext->PSSetShaderResources(0, 1, &pSkyDomeSRV);//sky+dome texture pImmediateContext->PSSetSamplers(0, 1, &CamSampState); pImmediateContext->Draw(4, 0); pImmediateContext->VSSetShader(0, NULL, 0); pImmediateContext->PSSetShader(0, NULL, 0); //backbuffer stage where lens flare code and terrain texture are set pImmediateContext->OMSetRenderTargets(1, &pRenderTargetView, pDepthStencilView); pImmediateContext->ClearRenderTargetView(pRenderTargetView, Colors::Black); pImmediateContext->ClearDepthStencilView(pDepthStencilView, D3D11_CLEAR_DEPTH, 1.0f, 0); // uiStride = sizeof(VTX); // pImmediateContext->IASetInputLayout(pVtxCamLayout); // pImmediateContext->IASetVertexBuffers(1, 1, &pVtxCamBuffer, &uiStride, &uiOffset); // pImmediateContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); pImmediateContext->VSSetShader(pVtxCamShader, NULL, 0); pImmediateContext->PSSetShader(pPixlCamShader, NULL, 0); pImmediateContext->PSSetShaderResources(0, 1, &pSRV);// dirty texture pImmediateContext->PSSetShaderResources(1, 1, &pSkyDomeBlurSRV);//sky+dome blurred texture pImmediateContext->PSSetShaderResources(2, 1, &pSkyDomeSRV);//sky+dome texture pImmediateContext->PSSetShaderResources(3, 1, &pTerSRV);//terrain texture pImmediateContext->PSSetSamplers(0, 1, &CamSampState); pImmediateContext->Draw(4, 0); pImmediateContext->VSSetShader(0, NULL, 0); pImmediateContext->PSSetShader(0, NULL, 0); pSwapChain->Present(0, 0);
  11. isu diss

    Adding Lens Flare

    Thank you very much sir!!!
  12. isu diss

    Loading FBX with Directx 11

    @AuskennfuchsThanks for your advice on manners. @galop1nThanks for your big help. I finally managed to do it. std::map code works like a charm. All I did is change p_index to its correct index, the value, returned by Mesh->GetPolygonVertex(i, j) and then magic happned. Anyone who wishes to make a fbx loader, can use my code. It works!!! Thanks everybody for support. Case closed.
  13. isu diss

    Duplicate Vertices using std::map

    I don't need vector method. std::map code works like a charm. All I did is change p_index to its correct index, the value, returned by Mesh->GetPolygonVertex(i, j) and then magic happned. Anyone who wishes to make a fbx loader, can use my code. It works!!! Thanks everybody for support. Case closed.
  14. isu diss

    Loading FBX with Directx 11

    Now help me, I made my own code and provided it.
  15. isu diss

    Duplicate Vertices using std::map

    How do I test comparison operators?
  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!