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

kavaari

Members
  • Content count

    5
  • Joined

  • Last visited

Community Reputation

110 Neutral

About kavaari

  • Rank
    Newbie
  1. Finally I got the problem solved. The problem was in the vertex declaration aka the input layout. I was using Vector4 to pass my position in to the vertex shader, but I changed it to Vector3 and updated my input layout and vertex stride accordingly. Now it works as intended, but I cannot understand why this would cause the UV's to be wrong, any ideas?
  2. I changed the grid creation code to more efficient one. I took the code almost straight from Riemers example, so there shouldn't be much errors in that, but still the problem exist, it's driving me crazy! [CODE] int iCounter = 0; //Vertices for (int x = 0; x < numSideTiles+1; x++) for (int z = 0; z < numSideTiles+1; z++) { float xPos = x * spacing; float zPos = z * spacing; vertices[x + z * (numSideTiles + 1)] = new PositionNormalTextured() { Position = new Vector4(xPos, 0, zPos, 1.0f), Normal = normal, UV = new Vector2(x, z) }; } //Indices for (int x = 0; x < numSideTiles; x++) for (int z = 0; z < numSideTiles; z++) { ushort lowerLeft = (ushort)(x + z * (numSideTiles+1)); ushort lowerRight = (ushort)((x + 1) + z * (numSideTiles + 1)); ushort topLeft = (ushort)(x + (z + 1) * (numSideTiles + 1)); ushort topRight = (ushort)((x + 1) + (z + 1) * (numSideTiles + 1)); indices[iCounter++] = topLeft; indices[iCounter++] = lowerRight; indices[iCounter++] = lowerLeft; indices[iCounter++] = topLeft; indices[iCounter++] = topRight; indices[iCounter++] = lowerRight; } [/CODE] Here is a picture of 5x5 quad, and as you can see it's a little different. [attachment=9350:5x5quadWTFv2.png] I'm thinking the problem is somewhere else than in the loop.
  3. I have a really weird problem, which I have tried to solve the whole day, yet no solution. I'm using DirectX10. This is a dead simple case: I have a grid based on number of tiles and spacing (size of one quad). [CODE] int vCounter = 0; int iCounter = 0; int indicesIndex = 0; for (int x = 0; x < numSideTiles; x++) for (int z = 0; z < numSideTiles; z++) { float xPos = x * spacing; float zPos = z * spacing; vertices[vCounter++] = new PositionNormalTextured() { Position = new Vector4(xPos, 0, zPos + spacing, 1.0f), Normal = normal, UV = new Vector2(1, 1) }; vertices[vCounter++] = new PositionNormalTextured() { Position = new Vector4(xPos + spacing, 0, zPos + spacing, 1.0f), Normal = normal, UV = new Vector2(0, 1) }; vertices[vCounter++] = new PositionNormalTextured() { Position = new Vector4(xPos, 0, zPos, 1.0f), Normal = normal, UV = new Vector2(1, 0) }; vertices[vCounter++] = new PositionNormalTextured() { Position = new Vector4(xPos + spacing, 0, zPos, 1.0f), Normal = normal, UV = new Vector2(0, 0) }; indices[iCounter++] = (ushort)(indicesIndex + 0); indices[iCounter++] = (ushort)(indicesIndex + 1); indices[iCounter++] = (ushort)(indicesIndex + 2); indices[iCounter++] = (ushort)(indicesIndex + 1); indices[iCounter++] = (ushort)(indicesIndex + 3); indices[iCounter++] = (ushort)(indicesIndex + 2); indicesIndex += 4; } DataStream vertexStream = new DataStream(36 * numVertices, true, true); vertexStream.WriteRange(vertices); DataStream indexStream = new DataStream(2 * numIndices, true, true); indexStream.WriteRange(indices); BufferDescription vertexBufferDesc = new BufferDescription() { BindFlags = BindFlags.VertexBuffer, CpuAccessFlags = CpuAccessFlags.None, OptionFlags = ResourceOptionFlags.None, SizeInBytes = 36 * numVertices, Usage = ResourceUsage.Default }; BufferDescription indexBufferDesc = new BufferDescription() { BindFlags = BindFlags.IndexBuffer, CpuAccessFlags = CpuAccessFlags.None, OptionFlags = ResourceOptionFlags.None, SizeInBytes = 2 * numIndices, Usage = ResourceUsage.Default }; vertexStream.Position = 0; indexStream.Position = 0; vertexBuffer = new SlimDX.Direct3D10.Buffer(device, vertexStream, vertexBufferDesc); indexBuffer = new SlimDX.Direct3D10.Buffer(device, indexStream, indexBufferDesc); device.Flush(); //More code between... //Final drawing code device.InputAssembler.SetInputLayout(InputElements.pntInputLayout); device.InputAssembler.SetPrimitiveTopology(PrimitiveTopology.TriangleList); device.InputAssembler.SetIndexBuffer(indexBuffer, SlimDX.DXGI.Format.R16_UInt, 0); device.InputAssembler.SetVertexBuffers(0, new VertexBufferBinding(vertexBuffer, 36, 0)); effect.GetTechniqueByIndex(0).GetPassByIndex(0).Apply(); device.DrawIndexed(numIndices,0, 0); [/CODE] The quads seems fine, but the texture is placed wrong on quads along left edge and on the last quad, on top left corner. 5x5 quad. [attachment=9338:5x5quadWTF.png] 100x100 quad. [attachment=9340:100x100quadwireframed.png] If spacing is two (quad size is two), then the texture will get stretched on Z-axis, even though the quad's vertices are fine. 10x10 quad. [attachment=9339:10x10quadWith2Spacing.png] For one quad it works as it should. [attachment=9337:1x1quadtexturedOK.png] Any help is appreciated.
  4. Is there any robust solution to get the furthest point on the camera viewport before rendering and then set the final camera far plane which is determined by the furthest point?
  5. Hi! I moved to D3D9 because the limitations of C# and XNA, so far so good. But now I hit to wall. I don't know how to make this in Cplusplus using D3D9 libraries. [SOURCE] public Vector3 Direction { get { return worldMatrix.Forward; } // Looking forward how to get this with D3D9 libraries set { Vector3 position = worldMatrix.Translation; // Looking forward how to get this too Vector3 forward = value; if (forward == Vector3.Up || forward == Vector3.Down) { Vector3 right = Vector3.Right; Vector3.Cross(ref right, ref forward, out up); //D3DXVec3Cross } //And for this too Matrix.CreateWorld(ref position, ref forward, ref up, out worldMatrix); } } [/SOURCE][/source]