• 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.

Matthew Meeks

Members
  • Content count

    15
  • Joined

  • Last visited

Community Reputation

218 Neutral

About Matthew Meeks

  • Rank
    Member
  1. That's what I thought.  I must have changed something somewhere else and not realized it had fixed it.  Thanks for your help.
  2.   Yeah, I had just changed that before posting and posted that before changing it back.  Anyways, I changed the name of the shader from VS_Shader to another name so that it wasn't the same as the other that didn't use them and now it works fine.  I didn't realize the name of the shader entry function would matter.
  3. Okay, but the first one does and it is unreferenced there as well.
  4. Yes to both of the first questions.  It shows as referenced for every draw call except for the specific ones with those vertex shaders set.  The buffers still show up as being set, just not referenced by the shaders.   I'm not exactly sure what you mean.  I didn't really mention anything about a pixel shader.  If it helps, I've tried adding the same constant buffers to the pixel shader and in the vertex, geometry, and pixel shader each shows unreferenced, yet in the calls directly before, using different shaders with the exact same code for declaring the constant buffers, everything is fine.
  5. I'm trying to make a particle system where I send a pointlist and expand quads from it.  I'd done this years ago but lost the code.  Everything seems to be fine except that the constant buffers (2 of them at 0 and 1) are somehow considered unreferenced for that draw call.  I've also noticed that the same happens when drawing sprites, though I had not noticed until now because I had no need of the constant buffers then.   I've tried taking out the geometry shader, using triangle lists, moving the order at which it is rendered, and setting the constant buffers to the vertex shader immediately before calling draw on the device context, and still no luck.  I'm using the Nsight plugin for Visual Studio to debug.  All the buffers contain the correct data, and every shader except the vertex shaders used for sprites and for the particles lists the constant buffers correctly.  I've checked the output with the Debug flag enabled and nothing appears between the time I prepare the particles to be rendered and after the call has been sent.   Only thing that I can think of is that it has something to do with the hlsl compiler not defining the buffers as referenced somehow.   Here's the code that renders (should render) the particles: internal override void Render() { //So I can tell where this begins in the output window System.Diagnostics.Debug.WriteLine("BEGIN PARTICLE"); //base.Render is an empty method at the moment base.Render(); if (buffer.Elements == 0) return; var o = Renderer.Context.InputAssembler.PrimitiveTopology; Renderer.Context.InputAssembler.PrimitiveTopology = SharpDX.Direct3D.PrimitiveTopology.PointList; Renderer.SetPSRes(ResLibrary.GetTex2D(Texture), 0); Renderer.Set(vs); Renderer.Set(fs); //storing the current geometry shader so that it can be set back after //probably will just remove this and set the geometry shader back to none var ogs = Renderer.Context.GeometryShader.Get(); Renderer.Set(gs); //Setting the constant buffers. These should already be set but just making sure. ShaderGlobals.SetWorld(Matrix.Identity); ShaderGlobals.UpdateCamera(Renderer.Scene.CurrentCamera.GetLocation(), Renderer.Scene.CurrentCamera.View, Renderer.Scene.CurrentCamera.Projection); Renderer.Set(buffer, 0, 0); Renderer.Draw(buffer.Elements, 0); Renderer.Context.GeometryShader.Set(ogs); Renderer.Context.InputAssembler.PrimitiveTopology = o; System.Diagnostics.Debug.WriteLine("END PARTICLE"); } Here are the vertex shaders that cause problems:   Particle Vertex Shader: cbuffer MatrixBuffer: register(b0) { matrix G_View; matrix G_Projection; float3 G_CamPos; float G_gt; }; cbuffer WorldBuffer: register(b1) { matrix G_World; float3x3 G_World3x3; }; struct VertexInputType { float4 position : POSITION; float4 color : COLOR; float2 texcoord0 : TEXCOORD0; }; struct PixelInputType { float4 position : SV_POSITION; float4 color : COLOR; float2 texcoord0 : TEXCOORD0; }; PixelInputType VS_Shader(VertexInputType input) { PixelInputType output; output.position = mul(input.position, G_World); output.position = mul(output.position, G_View); output.position = mul(output.position, G_Projection); output.position = input.position; output.texcoord0 = input.texcoord0; output.color = input.color; return output; } Sprite Vertex Shader: cbuffer MatrixBuffer: register(b0) { matrix G_View; matrix G_Projection; float3 G_CamPos; float G_gt; }; cbuffer WorldBuffer: register(b1) { matrix G_World; float3x3 G_World3x3; }; struct VertexInputType { float4 position : POSITION; float4 color : COLOR; float2 texcoord0 : TEXCOORD0; }; struct PixelInputType { float4 position : SV_POSITION; float4 color : COLOR; float2 texcoord0 : TEXCOORD0; }; PixelInputType VS_Shader(VertexInputType input) { PixelInputType output; input.position.w = 1.0f; output.position = input.position; output.texcoord0 = input.texcoord0; output.color = input.color; return output; } Any help at all is appreciated.  I've looked at this for several hours now trying to figure anything out and I'm out of ideas. Also if there's any more information I can give that might help let me know.
  6. From the album DX11 Engine

  7. From the album DX11 Engine

  8. Yes I am
  9. I'm having issues understanding how stencil buffers work.  I used them a few times in XNA but there appears to be many differences.  The comparison test always seems to pass and the objects are always drawn.   Here are my depth states: DepthStencilStateDescription dsStateDesc = new DepthStencilStateDescription() { IsDepthEnabled = true, IsStencilEnabled = false, DepthWriteMask = DepthWriteMask.All, DepthComparison = Comparison.Less }; DepthState = DepthStencilState.FromDescription(Device, dsStateDesc); //=== DepthStencilStateDescription dsaStateDesc = new DepthStencilStateDescription() { IsDepthEnabled = true, IsStencilEnabled = true, FrontFace = new DepthStencilOperationDescription() { Comparison = Comparison.Greater, FailOperation = StencilOperation.Keep, PassOperation = StencilOperation.Increment, DepthFailOperation = StencilOperation.Zero }, BackFace = new DepthStencilOperationDescription() { Comparison = Comparison.Always, FailOperation = StencilOperation.Keep, PassOperation = StencilOperation.Increment, DepthFailOperation = StencilOperation.Zero }, StencilWriteMask = 0, StencilReadMask = 1, DepthWriteMask = DepthWriteMask.All, DepthComparison = Comparison.Less }; addDepthState = DepthStencilState.FromDescription(Device, dsaStateDesc); //=== DepthStencilStateDescription dscStateDesc = new DepthStencilStateDescription() { IsDepthEnabled = true, IsStencilEnabled = true, FrontFace = new DepthStencilOperationDescription() { Comparison = Comparison.Equal, FailOperation = StencilOperation.Keep, PassOperation = StencilOperation.Keep, DepthFailOperation = StencilOperation.Keep }, BackFace = new DepthStencilOperationDescription() { Comparison = Comparison.Equal, FailOperation = StencilOperation.Keep, PassOperation = StencilOperation.Keep, DepthFailOperation = StencilOperation.Keep }, StencilReadMask = 1, StencilWriteMask = 1, DepthWriteMask = DepthWriteMask.All, DepthComparison = Comparison.Less }; compareDepthState = DepthStencilState.FromDescription(Device, dscStateDesc);   When I draw: Clear the depth/stencil buffer set the first depth state draw the world set the second depth state draw the cube to render the second view point on set the third depth state draw the world from the second view point   If this helps these are the XNA depth states I'm trying to mimic: DepthStencilState addIfPortal = new DepthStencilState() { StencilEnable = true, StencilFunction = CompareFunction.Always, StencilPass = StencilOperation.Increment }; DepthStencilState checkPortal = new DepthStencilState() { StencilEnable = true, StencilFunction = CompareFunction.Equal, ReferenceStencil = 1, StencilPass = StencilOperation.Keep };   I appreciate any help and thanks for your patience
  10. From the album DX11 First Attempts

    Trees, shadows, procedural sky, and some basic post-processing. Slowly coming along.
  11. DX11

    Nevermind passed the wrong description.
  12. DX11

    I have tried both with and without dividing by w with the same result.  I had placed the division of w to ensure that w was always one as it should have been.  I am not outputting to a depth-stencil buffer but rather a Texture2D render target.  Not sure if this is the preferred method but i choose this because I eventually want to do more with the shadow map (different levels of light from the same source for semitransparent objects).   EDIT: I will try binding a depth buffer and attempt that way.   Thanks for the help!
  13. From the album DX11 First Attempts

  14. From the album DX11 First Attempts