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

amadeus12

Members
  • Content count

    3
  • Joined

  • Last visited

Community Reputation

108 Neutral

About amadeus12

  • Rank
    Newbie
  1. this code is from introduction to DX11 by Frank D Luna. I kind of understand the theory of this. first get frustum coordinates in view space. get model's world matrix and view matrix. get inverse matrix to find out frustum's coordinates in model's local. my question is, why do I only need X component of scale matrix? what if the object got stretched by z,y axis? for(UINT i = 0; i < mInstancedData.size(); ++i) { XMMATRIX W = XMLoadFloat4x4(&mInstancedData.World); XMMATRIX invWorld = XMMatrixInverse(&XMMatrixDeterminant(W), W); // View space to the object's local space. XMMATRIX toLocal = XMMatrixMultiply(invView, invWorld); // Decompose the matrix into its individual parts. XMVECTOR scale; XMVECTOR rotQuat; XMVECTOR translation; XMMatrixDecompose(&scale, &rotQuat, &translation, toLocal); // Transform the camera frustum from view space to the object's local space. XNA::Frustum localspaceFrustum; //TransformFrustum(&localspaceFrustum, &mCamFrustum, XMVectorGetX(scale), rotQuat, translation); XNA::TransformFrustum(&localspaceFrustum, &mCamFrustum, XMVectorGetX(scale), rotQuat, translation); // Perform the box/frustum intersection test in local space. if(XNA::IntersectAxisAlignedBoxFrustum(&mSkullBox, &localspaceFrustum) != 0) { // Write the instance data to dynamic VB of the visible objects. dataView[mVisibleObjectCount++] = mInstancedData; } } md3dImmediateContext->Unmap(mInstancedBuffer, 0); }
  2. I wrote computeshader to blur image. But it returns black texture. actually I'm not using FX file and effect library. I use hlsl file and I bind it to pipeline myself with direct api. I have 2 hlsl files which do vertical, horizontal blur. here my CPU code which executes computeshader. void BoxApp::callComputeShaderandBlur(ID3D11DeviceContext * dc, ID3D11ShaderResourceView * inputSRV, ID3D11UnorderedAccessView * inputUAV, int blurcount) { for (int i = 0; i < blurcount; i++) { dc->CSSetShader(m_CSH, 0, 0); dc->CSSetShaderResources(0, 1, &inputSRV); dc->CSSetUnorderedAccessViews(0, 1, &mBlurOutPutTexUAV, 0); UINT numGroupsX = (UINT)ceilf(m_Width / 256.0f); dc->Dispatch(numGroupsX, m_Height, 1); dc->CSSetShaderResources(1, 0, 0); dc->CSSetUnorderedAccessViews(1, 0, 0, 0); dc->CSSetShader(m_CSV, 0, 0); dc->CSSetShaderResources(0, 1, &mBlurOutPutTexSRV); dc->CSSetUnorderedAccessViews(0, 1, &inputUAV, 0); UINT numGroupY = (UINT)ceilf(m_Height / 256.0f); dc->Dispatch(m_Width, numGroupY, 1); dc->CSSetShaderResources(1, 0, 0); dc->CSSetUnorderedAccessViews(1, 0, 0, 0); } dc->CSSetShaderResources(1, 0, 0); dc->CSSetUnorderedAccessViews(1, 0, 0, 0); dc->CSSetShader(0, 0, 0); } If I don't call this function, everything is fine. (I rendered my scene to off screen redertarget and use this texture as quad texture. and render it to real rendertarget. it worked fined) That means there's problem in ComputeShader code. Every resource and view isn't null pointer, I checked it. all HRESULTs are S_OK. here my 2 shader codes this is CSH.hlsl static float gWeights[11] = { 0.05f, 0.05f, 0.1f, 0.1f, 0.1f, 0.2f, 0.1f, 0.1f, 0.1f, 0.05f, 0.05f, }; static const int gBlurRadius = 5; Texture2D gInput; RWTexture2D<float4> gOutput; #define N 256 #define CacheSize (N + 2*gBlurRadius) groupshared float4 gCache[CacheSize]; [numthreads(N, 1, 1)] void main(int3 groupThreadID : SV_GroupThreadID, int3 dispatchThreadID : SV_DispatchThreadID) { // // Fill local thread storage to reduce bandwidth. To blur // N pixels, we will need to load N + 2*BlurRadius pixels // due to the blur radius. // // This thread group runs N threads. To get the extra 2*BlurRadius pixels, // have 2*BlurRadius threads sample an extra pixel. if (groupThreadID.x < gBlurRadius) { // Clamp out of bound samples that occur at image borders. int x = max(dispatchThreadID.x - gBlurRadius, 0); gCache[groupThreadID.x] = gInput[int2(x, dispatchThreadID.y)]; } if (groupThreadID.x >= N - gBlurRadius) { // Clamp out of bound samples that occur at image borders. int x = min(dispatchThreadID.x + gBlurRadius, gInput.Length.x - 1); gCache[groupThreadID.x + 2 * gBlurRadius] = gInput[int2(x, dispatchThreadID.y)]; } // Clamp out of bound samples that occur at image borders. gCache[groupThreadID.x + gBlurRadius] = gInput[min(dispatchThreadID.xy, gInput.Length.xy - 1)]; // Wait for all threads to finish. GroupMemoryBarrierWithGroupSync(); // // Now blur each pixel. // float4 blurColor = float4(0, 0, 0, 0); [unroll] for (int i = -gBlurRadius; i <= gBlurRadius; ++i) { int k = groupThreadID.x + gBlurRadius + i; blurColor += gWeights[i + gBlurRadius] * gCache[k]; } gOutput[dispatchThreadID.xy] = blurColor; } and this is CSV static float gWeights[11] = { 0.05f, 0.05f, 0.1f, 0.1f, 0.1f, 0.2f, 0.1f, 0.1f, 0.1f, 0.05f, 0.05f, }; static const int gBlurRadius = 5; Texture2D gInput; RWTexture2D<float4> gOutput; #define N 256 #define CacheSize (256 + 2*5) groupshared float4 gCache[CacheSize]; [numthreads(1, N, 1)] void main(int3 groupThreadID : SV_GroupThreadID, int3 dispatchThreadID : SV_DispatchThreadID) { // // Fill local thread storage to reduce bandwidth. To blur // N pixels, we will need to load N + 2*BlurRadius pixels // due to the blur radius. // // This thread group runs N threads. To get the extra 2*BlurRadius pixels, // have 2*BlurRadius threads sample an extra pixel. if (groupThreadID.y < gBlurRadius) { // Clamp out of bound samples that occur at image borders. int y = max(dispatchThreadID.y - gBlurRadius, 0); gCache[groupThreadID.y] = gInput[int2(dispatchThreadID.x, y)]; } if (groupThreadID.y >= N - gBlurRadius) { // Clamp out of bound samples that occur at image borders. int y = min(dispatchThreadID.y + gBlurRadius, gInput.Length.y - 1); gCache[groupThreadID.y + 2 * gBlurRadius] = gInput[int2(dispatchThreadID.x, y)]; } // Clamp out of bound samples that occur at image borders. gCache[groupThreadID.y + gBlurRadius] = gInput[min(dispatchThreadID.xy, gInput.Length.xy - 1)]; // Wait for all threads to finish. GroupMemoryBarrierWithGroupSync(); // // Now blur each pixel. // float4 blurColor = float4(0, 0, 0, 0); [unroll] for (int i = -gBlurRadius; i <= gBlurRadius; ++i) { int k = groupThreadID.y + gBlurRadius + i; blurColor += gWeights[i + gBlurRadius] * gCache[k]; } gOutput[dispatchThreadID.xy] = blurColor; } sorry about poor english. plz help I'm really sad... I spend whole day for this... It doesn't work.. feels bad man..
  3. I think that's plane not part of rock model..
  4. I made .OBJ file parser. but something wierd happened. in OBJ file, there're 254 vertices. but in face section, it indicate 258th vertex. I attach file here.