• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.


  • Content count

  • Joined

  • Last visited

Community Reputation

430 Neutral

About Endemoniada

  • Rank
    Advanced Member
  1. Hi guys, The only way I can get a CCW winding order to work is to use D3D11_CULL_NONE. Take a look: // ccw triangle on x-z plane a = (-8.0f, 0.0f, -8.0f); b = ( 8.0f, 0.0f, -8.0f); c = ( 8.0f, 0.0f,  8.0f); rasterDesc.CullMode = D3D11_CULL_BACK; rasterDesc.FrontCounterClockwise = TRUE; // that doesn't work // if I swap b with c,  and set FrontCounterClockwise = FALSE it works I am really confused. Thanks.
  2. Hi guys,   I'm still not sure about what variable types to use for buffers and shaders. It's easier to explain with code:   // vertex layout   D3D11_INPUT_ELEMENT_DESC layout[] = {  { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },  { "TEXCOORD", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 }, };   I use a float3 for the position, should it instead be float4 ? Also, I like to use a float4 for the uv so I can use the .zw components for custom data but what if I only use the .xy components, should it then be float2 ?   The same question applies to the shader itself:   struct VS_INPUT {  float3 position : POSITION;  float4 uv : TEXCOORD0; }; Should these exactly match the layout (like they do here) ?   This has always confused me. Thanks.
  3. Thanks a lot everyone, especially Matt, for taking the time to explain it to me.
  4. Hi guys,   Do I need to do anything special to get built-in bilinear filtering ?   Here is what I'm doing:     // sampler   D3D11_SAMPLER_DESC desc; desc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; ...   // simple shader   struct VS_INPUT {  float4 position : POSITION;  float2 uv : TEXCOORD0; }; struct VS_OUTPUT {  float4 position : SV_POSITION;  float2 uv : TEXCOORD0; };   VS_OUTPUT vshader(VS_INPUT input) {  VS_OUTPUT output;  output.position = float4(input.position.xyz, 1.0f);  output.uv = input.uv;  return output; }   float4 pshader(VS_OUTPUT input) : SV_TARGET {  return float4(Texture0.Sample(Sampler0, input.uv).xyz, 1.0f); }   It's basically just a copy shader so I use it for both (1/2x) downsampling and (2x) upsampling.   It seems alright but maybe I can get better results another way ?   Also, I may write my own filter and would like to know if I am getting the center of the pixels with the code above, so that a pixel to the right of the pixel shader input would be (input.uv.x + 1.0f / texture_width) ? I am pretty sure that's what SV_POSITION does, however, I want to be certain.   Thank you.  
  5. Hi guys,   I used to use techniques to combine two shaders that do pretty much the same thing, like a two-pass blur shader. Is there a way to do somethng similar in D3D11 ?   I know I can pass a variable via the constant buffer and do a conditional but that's not very satisfying.   Thanks.  
  6. Hi,   Just offhand your class can have either it's own data struct matching the constant buffer or a pointer to a global one, then when you use the shader just call UpdateSubresource().   Something like this:   // generic buffer   struct ConstBuffer { float4 data0; float4 data1; };   // create the d3d11 const buffer   ID3D11Buffer* d3d_const_buffer;   D3D11_BUFFER_DESC desc; ZeroMemory(&bd, sizeof(desc));   desc.Usage = D3D11_USAGE_DEFAULT; desc.ByteWidth = sizeof(ConstBuffer); desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; desc.CPUAccessFlags = 0;   hResult = d3d_device->CreateBuffer(&desc, nullptr, &d3d_const_buffer);   // now make it class-friendy   class Shader { // local buffer ConstBuffer const_buffer;   // easy functions to fill in the local buffer void SetLightPos(float4 v) {const_buffer.data0 = v;} void SetLightColour(float4 v) {const_buffer.data1 = v;} };   // use the shader when rendering   Shader light_shader; light_shader.SetLightPos(vLightPos); light_shader.SetLightColour(vLightColour);   d3d_context->UpdateSubresource(d3d_const_buffer, 0, nullptr, &light_shader.const_buffer, 0, 0);   Is that what you mean ?
  7. DX11

    Hi,   Here are two different ways I set my quality, they may not be the best ways to do it:   UINT msaa_quality;   // method 1   msaa_quality = D3D11_STANDARD_MULTISAMPLE_PATTERN;   // method 2   DXGI_FORMAT format = DXGI_FORMAT_R8G8B8A8_UNORM; // or the format you're using UINT msaa_samples = 4; // or 2, 8, etc.   hResult = d3d_device->CheckMultisampleQualityLevels(DXGI_FORMAT_R8G8B8A8_UNORM, msaa_samples, &msaa_quality); msaa_quality--;  
  8. Hi guys,   I am trying to convert to an HDR system but when I use any format other than R8G8B8A8_UNORM my call to ResolveSubresource() fails.   I get this error: ...Source Resource format is (0x2, R32G32B32A32_FLOAT). Resolve Format is (0x1c, R8G8B8A8_UNORM)   I made sure to create the resolve texture with R32G32B32A32_FLOAT.   I also made sure this doesn't fail: CheckMultisampleQualityLevels(DXGI_FORMAT_R32G32B32A32_FLOAT,...)   Now matter how I create the resolve texture it tells me it's format is R8G8B8A8_UNORM.   What can I do ? Thank you.  
  9. Hi guys,   I found only two practical articles on temporal smoothing and they leave a lot out.   I read this:   "To combine them, we simply took previous ssao buffer (so it became effectively accumulation texture), took offset based on motion vectors, read it and after deciding on rejection or acceptance (smooth weight) combined them together with a fixed exponential decay (weight of 0.9 for history accumulation buffer on acceptance, it got down to zero on rejection) and output the AO."   I don't know what motion vectors are, or how to accept/reject data based on them. The article makes it seem so simple.   I can use any info you may think is helpful.   Thanks.  
  10. Hi guys,   What format should I use when rendering and blurring SSAO ? I only need one channel. I've been using DXGI_FORMAT_R8G8B8A8_UNORM but I'm wondering if I'd be better off using DXGI_FORMAT_R32_FLOAT or DXGI_FORMAT_R16_FLOAT or perhaps DXGI_FORMAT_R8_UNORM.   My main concern is compatibility and speed, not so much memory usage.   Thanks.  
  11. Hi HappyCoder,   I don't know what you mean by applying a translation *after* the perspective transform.   I pass the WorldViewProjection to the shader and it does the transform:   world = DirectX::XMMatrixIdentity(); view = DirectX::XMMatrixLookAtLH(eye, look, up); projection = DirectX::XMMatrixPerspectiveFovLH(pi / 4.0f, aspect_ratio, near_z, far_z);   // for shader world_view = DirectX::XMMatrixMultiply(world, view); world_view_projection = DirectX::XMMatrixMultiply(world_view, projection);   Thanks for helping.
  12. Hi guys,   Is is possible to make (an unrealistic) projection that appears as if the camera is offset even though it isn't ?   The image on the left is a regular projection, the look at point is the black object. I want it to be like the image on the right which I made by moving the look at point to the right (x+ axis) and then using Photoshop to move the cube back to the center.   Thanks.      
  13. Hi guys,   I don't really understand what is going on here: // this is simplified for clarity   // set render target to rt0 d3d_context->OMSetRenderTargets(1, &d3d_rt0_view, nullptr);   d3d_context->Draw(...);   // now use rt0 as shader input   // set render target to rt1 (shouldn't this unbind rt0 ?) d3d_context->OMSetRenderTargets(1, &d3d_rt1_view, nullptr);   // this breaks my ssao and causes debug errors d3d_context->PSSetShaderResources(0, 1, &d3d_rt0_shader_view);   d3d_context->Draw(...); I'm basically rendering to textures then using them in a shader (for SSAO, etc.)   Thanks.     *SOLVED*   I have to unbind it explicitly like this:   ID3D11ShaderResourceView* srvs[1] = { nullptr }; d3d_context->PSSetShaderResources(0, 1, srvs);  
  14. Thanks for clearing that up for me Hodgman.   PS - that site you linked has some great stuff
  15. Hi guys,   When I render (generate) my depth and normals to a screen-sized texture for post-processing stuff like SSAO (not for deferred rendering) do I turn off MSAA ? If not, do I have to resolve the depth and normal textures I generated ?   I'm confused.   Thanks.