Jump to content
  • Advertisement

trojanfoe

Member
  • Content count

    25
  • Joined

  • Last visited

Community Reputation

118 Neutral

About trojanfoe

  • Rank
    Member

Personal Information

Social

  • Twitter
    trojanfoe
  • Github
    http://github.com/trojanfoe
  • Steam
    trojanfoe

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. trojanfoe

    Unity SetQualityLevel persistence

    Option 5 sounds best to me, if my vote counts
  2. I would personally not bother with the single-header file implementation and instead move the implementation into .cpp files. You will end up with cleaner looking code and avoid your issue altogether.
  3. trojanfoe

    Migrating from Win32 (DX) to UWP

    Looking at the UWP documentation it looks like this requirement to use DirectX 12 in order to get full access to the GPU is not true at all. That's very good news as it means you can use DirectX 11 and provide Win32 binaries targetting Win7 (still 35% market share?) as well as UWP apps targetting Win10/XBoxONE. Can anyone confirm this?
  4. trojanfoe

    Migrating from Win32 (DX) to UWP

    I am also interested in targetting UWP but have never developed for it. You will get a flavour of what's involved if you install the Direct3D Game Templates for VS and create a solution with a "UWP DirectX 11 (or 12) DR C++/WinRT" project and a "Win32" version and look at the implementation in Main.cpp and DeviceResources.cpp (Game.cpp is 99% the same in both, which is greate). From what I can see you won't have to learn much about UWP and WinRT as that's taken care of by the template (WinRT is the Windows Runtime subset of Win32 API calls that's supported on all Win10 platforms). Also check out this video about C++/WinRT from Microsoft as it means you can write in ISO C++ and not C++/CX and that's a good thing. Something else I found out recently is that if you want more of the GPU from your UWP game on Xbox One then it needs to be DirectX 12, which could be a show-stopper for some.
  5. Yep, that was my next step, however I thought I'd just ask to see if it was possible.
  6. OK, so that's not working. This is what it tooks like (text is bottom left): Here is the blend state creation code: D3D11_BLEND_DESC blendDesc = {}; blendDesc.RenderTarget[0].BlendEnable = TRUE; blendDesc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL; blendDesc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD; blendDesc.RenderTarget[0].SrcBlend = D3D11_BLEND_ONE; blendDesc.RenderTarget[0].DestBlend = D3D11_BLEND_SRC_ALPHA; blendDesc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD; blendDesc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE; blendDesc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ZERO; ThrowIfFailed( d3dDevice->CreateBlendState(&blendDesc, s_invertedBlendState.GetAddressOf()), "create Text inverted blend state" ); and here is the pixel shader: Texture2D txDiffuse : register(t0); SamplerState samp : register(s0); float4 main(PS_IN_PosColTex input) : SV_TARGET { float4 color = txDiffuse.Sample(samp, input.tex); return float4(color.rgb * color.a + 1 - color.a, color.a - 1); } However on the screen the text has black boxes instead of white from the screenshot. I use a stack of Scene objects with the UI Scene being on top. In the render loop I clear a render target to transparent and each Scene renders their content onto the render target and finally the render target is written to the window render target (this is for future expand where post-processing is expected). Would have some bearing on any of this?
  7. Whoa! That's amazing. I'll try this tonight and get back to you. Many thanks!
  8. Yes. Basically I want to see the text regardless of colour of the pixel behind (this is only for debug text as I don't think that would look much good in production).
  9. I have been trying to create a BlendState for my UI text sprites so that they are both alpha-blended (so you can see them) and invert the pixel they are rendered over (again, so you can see them). In order to get alpha blending you would need: SrcBlend = SRC_ALPHA DestBlend = INV_SRC_ALPHA and in order to have inverted colours you would need something like: SrcBlend = INV_DEST_COLOR DestBlend = INV_SRC_COLOR and you can't have both. So I have come to the conclusion that it's not possible; am I right?
  10. I had problem the VS graphics debugger crashing when I don't take a snapshot. If I take one, it's ok (this is using VS2017 with latest update). How do people rate nsight against the VS graphics debugger or RenderDoc?
  11. OK, fixed it. Beginners mistake. I had forgotten to set the viewport of the window before rendering from render texture to window
  12. Hi there, I am rendering my game to render textures but I am having difficulty figuring out how to scale it to fill the window. The window looks like this: and the render texture looks like this (it's the window resolution downscaled by 4): (I implemented a screenshot function of the render texture which has proved to be very useful getting this working so far). My vertex shader is the classic "draw fullscreen triangle without binding a vertex or index buffer" as seen many times on this site: PS_IN_PosTex main(uint id : SV_VertexID) { PS_IN_PosTex output; output.tex = float2((id << 1) & 2, id & 2); output.pos = float4(output.tex * float2(2, -2) + float2(-1, 1), 0, 1); return output; } and the pixel shader is simply: Texture2D txDiffuse : register(t0); SamplerState samp : register(s0); float4 main(PS_IN_PosTex input) : SV_TARGET { return txDiffuse.Sample(samp, input.tex); } Can someone please give me a clue as to how to scale this correctly? Many thanks, Andy
  13. Hey thanks for the information CortexDragon.
  14. Hi CortexDragon, you originally had lots of interesting looking information in your reply about how various techniques could be used to do this properly, but you edited it away. Why was that?
  15. Hey thanks for the reply. I seem to be getting pretty good results by sorting back-to-front and then by texture, so I will just dump the depth state stuff altogether.
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!