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

belfegor

Members
  • Content count

    801
  • Joined

  • Last visited

Community Reputation

2834 Excellent

About belfegor

  • Rank
    Advanced Member

Personal Information

  • Location
    Serbia
  1. I was using DX9 long time. Before i could use depth/stencil buffer with render target that has smaller size without a problem. Now i get this error: D3D11 ERROR: ID3D11DeviceContext::OMSetRenderTargets: The RenderTargetView at slot 0 is not compatable with the DepthStencilView. DepthStencilViews may only be used with RenderTargetViews if the effective dimensions of the Views are equal, as well as the Resource types, multisample count, and multisample quality. The RenderTargetView at slot 0 has (w:640,h:360,as:1), while the Resource is a Texture2D with (mc:1,mq:0). The DepthStencilView has (w:1280,h:720,as:1), while the Resource is a Texture2D with (mc:1,mq:0). D3D11_RESOURCE_MISC_TEXTURECUBE factors into the Resource type, unless GetFeatureLevel() returns D3D_FEATURE_LEVEL_10_1 or greater. [ STATE_SETTING ERROR #388: OMSETRENDERTARGETS_INVALIDVIEW] I thought i could reuse same DS. Such a waste if i have to create DS for every RT that doesnt match in size.
  2. Check each point and grab the min/max, center is (min + max) * 0.5 Better yet approximate size so you don't need to recalculate every frame.
  3. Use CreateTexture to create new texture then use GetSurfaceLvl to grab its surface then use UpdateSurface to copy to it from your surface,  tho i don't understand why do you even load surface from file instead texture?
  4. Maybe he wants to copy some surface to new texture?
  5. I don't even use scaling (i don't need it at runtime for my project), as for translation and rotation i just compose into one matrix from vector and quaternion, and this is done only for "dynamic" objects since i have lot of static objects (where world is identity) so i can skip lots of unnecessary world*view*proj (so i have just one view*proj for all of those).
  6. What is the problem? You have many examples within their sdk.   Main part is :     btCollisionWorld::ClosestRayResultCallback result(from, to);     physicsWorld->rayTest( from, to, result );   ... //  use result here
  7. Thanks. I thought it was only relevant on old nvidia FX series, so it makes a difference on mobile devices too.
  8. As kauna said you need to normalize light vector and normal of the surface to get reasonable result from dot product (-1, 1) and then use saturate to get value (0, 1) so you can scale your diffuse color (0 - 100%) based on light/normal orientation, on top of that ambient color should be uniform from all directions so you might want to add it instead multiply, something like: float3 diffuseMap = txDiffuse.Sample(...); float3 LightDir = normalize(PosD); float3 Normal = normalize(In.Normal);   float3 LighD = float3 (0.5f, 0.5f, 0.5f); float3 LighA = float3 (0.2f, 0.2f, 0.2f);   float NdotL = saturate(dot(Normal, LightDir)); FinalColor.rgb = (NdotL * diffuseMap * LighD) + LighA;
  9. Sorry to interrupt into your thread. I have one question, what is your reasoning for using half instead of float?
  10. ^ +1   Usually obj, 3ds, fbx... are used as "interchange" formats so you can easily transfer/edit across multiple programs since they are well known/supported for import/export, but for your project/game you want to use your own binary format structured in a way that holds only data relevant for your needs, you can even merge multiple models/textures/whatever files in one file to reduce disk I/O count and make it even faster on load.
  11. I created simple class for you that wrap whole thing in one place   http://pastebin.com/SigypwK3   and then you can write simple shader to draw with:   float4x4 WorldViewProjection;   struct VERTEX {     float3 Position : POSITION;     float3 Color    : COLOR; }; struct V2P {     float4 Position : POSITION;     float3 Color    : COLOR; };   struct P2A {     float4 Color : COLOR; }; void vs(in VERTEX IN, out V2P OUT) {     OUT.Position = mul(float4(IN.Position.xyz, 1.0f), WorldViewProjection);     OUT.Color = IN.Color; } void ps(in V2P IN, out P2A OUT) {     OUT.Color = float4(IN.Color, 1.0f); }   technique Tech {     pass p0     {         VertexShader = compile vs_3_0 vs();         PixelShader = compile ps_3_0 ps();     } }
  12. That seems fine, there must be something else wrong then.
  13. You cannot have 2 pixel shaders run simultaneously, you probably meant "helper" function. If you don't want to post whole shader at least show me the whole "pipeline" for uv coordinates (how it is calculated/obtained). I suspect at this because the rest of code is correct.   It doesn't matter if you are in "post-processing stage", you must have vertex shader, even if you dont set it yourself it is possible that it is set for you behind scene/implicitly by their shader system.
  14. You need to debug further. How do you build your VB now? rcPolyMeshDetail might be like indexed mesh but you draw your debug mesh without indices so you need to be careful how to extract/fill correct data into it as no vertices are "shared" that way.
  15. I think i read somewhere that in "Debug" mode every variable is intialized with 0, "Release" gives you garbage values.   What happend, the mesh is created with D3DXCreateMesh (which then you never use as i can see), but its verticess/indices are not yet assigned and you used them which is wrong! You need to extract that info from rcPolyMeshDetail and pass that to SetProps     edit: remove * 3 in CreateVertexBuffer and CopyMemory edit2: //CopyMemory ( pData, (void*)&m_Vertices, sizeof(CPerfectVertex) * 3 * m_Vertices.size()); CopyMemory ( pData, (void*)&m_Vertices[0], sizeof(CPerfectVertex) * m_Vertices.size()); // notice [0], it is very different thing! edit3: You need to call SetStreamSource right before DrawPrimitive (unless this is the only thing you render which i doubt).