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

KaiserJohan

Members
  • Content count

    410
  • Joined

  • Last visited

Community Reputation

2317 Excellent

About KaiserJohan

  • Rank
    Member
  1.   Makes sense. The 'BoundsY' for a quad is calculated on the CPU once by reading the heightmap and making an AABB? Can this be used in conjunction with other terrain tessellation alghorithms (like http://www.frostbite.com/wp-content/uploads/2013/05/adaptive_terrain_tessellation.pdf)?
  2. So I'm trying to implement terrain tessellation. I suppose it should be as simple as draw an enormous quad patch, generate new vertices and then offset the y-coordinate using a heightmap. Am I correct that far? :) What I'm curious is how do you perform any form of culling of the terrain geometry at this point. Say only a small part of this large quad is visible, how do you prevent it from tessellating alot of soon-to-be-unused vertices?
  3. As the title says :) Using my mouse, I want to pick out a texel on a mesh I have rendered and modify that texel. I start by picking a screen coordinate using my mouse. I then convert this screen coordinate to a world coordinate (using depth value at that pixel + inverse wvp matrix). This world coordinate is on the mesh at the pixel of the texture I want to modify. The question is how do I then go from world coordinate to texture coordinate on that specific texture?
  4. Anyone?
  5.   Great post. I'm at the point where I extracted world pos successfully, the question is how do I obtain heigthmap coords from that?
  6. DX11

      almost sounds like a  raypick vs ground mesh problem.      It probably very much is :) do you have any light to shed on the subject?
  7. DX11

    I do use the stencil buffer for reducing overdraw when doing point lights. 
  8. DX11

    I am doing this in my editor to raise/lower terrain (i.e increment/decrement values in a heightmap). To do that I first need to reconstruct the 3d point from 2d screen coords and for that I need depth for that pixel (afaik) and then somehow go from that 3d point to modify the correct hieghtmap texel (but that is a later problem).
  9. DX11

      What do you estimate would be the most efficient way of doing it (copy entire depthbuffer and read one texel -VS- use a CS/PS to output to a 1x1 staging texture and read that?)
  10. DX11

    This is my depthbuffer, also used for my staging texture except for cpuAccess, usage and bindflags: // create depth buffer D3D11_TEXTURE2D_DESC depthStencilBufferDesc; ZeroMemory(&depthStencilBufferDesc, sizeof(D3D11_TEXTURE2D_DESC)); depthStencilBufferDesc.ArraySize = 1; depthStencilBufferDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_DEPTH_STENCIL; depthStencilBufferDesc.Format = DXGI_FORMAT_R24G8_TYPELESS; depthStencilBufferDesc.Width = backbufferTextureDesc.Width; depthStencilBufferDesc.Height = backbufferTextureDesc.Height; depthStencilBufferDesc.MipLevels = 1; depthStencilBufferDesc.SampleDesc.Count = 1; depthStencilBufferDesc.Usage = D3D11_USAGE_DEFAULT; depthStencilBufferDesc.SampleDesc.Count = 1 is not multisampled right? (i.e it should work?)
  11. I was trying to find something similiar to glReadPixel() and stumbled upon this post: https://www.gamedev.net/topic/594722-reading-one-pixel-from-texture-to-cpu-in-dx11/   Seemed reasonable, tried it but lo and behold didnt work.   Sample code; { DX11DepthBufferReadback::DX11DepthBufferReadback(ID3D11DevicePtr device, ID3D11DeviceContextPtr context, ID3D11Texture2DPtr depthBuffer) : mContext(context), mDepthbuffer(depthBuffer), mStaging1x1(nullptr) { D3D11_TEXTURE2D_DESC depthTextureDesc; ZeroMemory(&depthTextureDesc, sizeof(depthTextureDesc)); depthBuffer->GetDesc(&depthTextureDesc); depthTextureDesc.Usage = D3D11_USAGE_STAGING; depthTextureDesc.BindFlags = 0; depthTextureDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; device->CreateTexture2D(&depthTextureDesc, NULL, &mStaging1x1); } float DX11DepthBufferReadback::GetDepthValue(const WindowPosition& position) const { D3D11_BOX box; ZeroMemory(&box, sizeof(box)); box.left = position.x; box.right = box.left + 1; box.top = position.y; box.bottom = box.top + 1; box.front = 0; box.back = 1; mContext->CopySubresourceRegion(mStaging1x1, 0, 0, 0, 0, mDepthbuffer, 0, &box); D3D11_MAPPED_SUBRESOURCE mappedRes; mContext->Map(mStaging1x1, 0, D3D11_MAP_READ, 0, &mappedRes); float depth = *static_cast<float*>(mappedRes.pData); mContext->Unmap(mStaging1x1, 0); return depth; } } This is the debug ouput I get: D3D11 ERROR: ID3D11DeviceContext::CopySubresourceRegion: If CopySubresourceRegion is used with Multisampled or D3D11_BIND_DEPTH_STENCIL Resources, then the whole Subresource must be copied. DstX, DstY, and DstZ must all be 0, while pSrcBox must be NULL. [ RESOURCE_MANIPULATION ERROR #280: COPYSUBRESOURCEREGION_INVALIDSOURCEBOX] So this dosn't seem to work. Is there any similiarly easy/straight forward solution that works?  
  12. I struggled abit with this one aswell. The difficult part is knowing where the issue is since its alot of things that have to work in unison.   FYI here's my shader code:   float4x4 BuildBoneTransform(const uint4 boneIndices, const float4 boneWeights) { uint boneIndex = boneIndices[0]; float boneWeight = boneWeights[0]; float4x4 boneTransform = gBones[boneIndex] * boneWeight; for (uint boneNum = 1; boneNum < NUM_BONES_PER_VERTEX; ++boneNum) { boneIndex = boneIndices[boneNum]; boneWeight = boneWeights[boneNum]; boneTransform += gBones[boneIndex] * boneWeight; } return boneTransform; } Your assimp mat4 --> glm mat4 looks correct.   Can't comment on the rest atm untill I get home :)   EDIT: since you are using the bob model I assume you have read the ogldev tutorial. Try emulate it as close as possible. It also helps downloading graphics debugging tool RenderDoc and then run both the ogldev sample and yours and inspect/compare the shader execution results.
  13.   Ahh mouse acceleration, that makes sense!   I guess I could just use GetCursorPos() when I need the screen coordinates instead. (There are no hidden costs associated with it?) 
  14. This is weird, it's such a simple algorithm so I don't understand why it doesn't behave as expected
  15.   RAWMOUSE contains relative mouse movement afaik? (or rather it has a bit set for either absolute/relative but on my machine its definately relative)   mMouseData.mRelativePos is the mouse movement relative to last time it was queried