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


  • Content count

  • Joined

  • Last visited

Community Reputation

114 Neutral

About JezzaP

  • Rank
  1. First blog post: http://perturbationgames.esy.es/2016/08/08/week-of-awesome-iv-initial-thoughts/
  2. does anyone have a local copy of this sample? I really would like to see it but the link is dead.
  3. Thanks, I never of the existence of such classes. That's a real help.
  4. Is there a way in DirectX to check if a resource has already been released? If you try to release something twice, it will give Access Violations. Say I have a texture, which two pointers point to. I can release from one and nullify the pointer, but without checking if that is nullified I shan't know whether to attempt to release the other. If I wanted the pointers to be independent then I have a problem.
  5. Can anyone see the problem in this code? Or want to see more? EDIT: How strange. I upgraded to the latest dx version (March, I was using November 08) and it works. I also changed all the shaders to model 2 instead of 3. One of those made it work. Ah well. [Edited by - JezzaP on May 29, 2009 8:22:02 AM]
  6. Ok here is my vertex shader: vertexOutput std_VS(appdata IN) { vertexOutput OUT = (vertexOutput)0; OUT.WorldNormal = normalize(mul(IN.Normal,WorldITXf).xyz); if(useNorm){ OUT.WorldTangent = normalize(mul(IN.Tangent,WorldITXf).xyz); OUT.WorldBinormal = normalize(mul(IN.Binormal,WorldITXf).xyz); } float4 Po = float4(IN.Position.xyz,1); float3 Pw = mul(Po,WorldXf).xyz; if(1==lightType){ OUT.LightVec = lightDir - Pw; }else OUT.LightVec = lightDir; if(flipy){ if(flipx) OUT.UV = float2((1.0-IN.UV.x),(1.0-IN.UV.y)); else OUT.UV = float2(IN.UV.x,(1.0-IN.UV.y)); } else{ if(flipx) OUT.UV = float2((1.0-IN.UV.x),IN.UV.y); else OUT.UV = float2(IN.UV.x,IN.UV.y); } OUT.WorldView = normalize(ViewIXf[3].xyz - Pw); OUT.HPosition = mul(Po,WvpXf); return OUT; } Where the matrices are: float4x4 WorldITXf : WorldInverseTranspose; float4x4 WvpXf : WorldViewProjection; float4x4 WorldXf : World; float4x4 Projection : Projection; float4x4 ViewIXf : ViewInverse; float4x4 WorldIXf : WorldInverse; structs: /* data from application vertex buffer */ struct appdata { float3 Position : POSITION; float4 UV : TEXCOORD0; float4 Normal : NORMAL; float4 Tangent : TANGENT; float4 Binormal : BINORMAL; }; /* data passed from vertex shader to pixel shader */ struct vertexOutput { float4 HPosition : POSITION; float2 UV : TEXCOORD0; float3 WorldNormal : TEXCOORD2; float3 WorldTangent : TEXCOORD3; float3 WorldBinormal : TEXCOORD4; float3 WorldView : TEXCOORD1; float3 LightVec : TEXCOORD5; float3 Attenuation : TEXCOORD6; }; The samplers all look like this: sampler ColorSampler = sampler_state { texture = <ColorTexture> ; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; AddressU = WRAP; AddressV = WRAP; AddressW = WRAP; }; The matrices are set like this: sys->Device->GetTransform(D3DTS_VIEW, &matView); sys->Device->GetTransform(D3DTS_PROJECTION, &matProjection); D3DXMatrixInverse(&matInverseView, NULL, &matView); matWorld = new D3DXMATRIX[numObjects]; matWorldViewProjection = new D3DXMATRIX[numObjects]; matWorldView = new D3DXMATRIX[numObjects]; matWorldInverseTransponse = new D3DXMATRIX[numObjects]; matWorldInverse = new D3DXMATRIX[numObjects]; phong.Shader->SetMatrix("ViewIXf", &matInverseView); for(int i2=0; i2<numObjects; i2++){ matWorld[i2]=objects[i2].pose; D3DXMatrixMultiply(&matWorldView[i2], &matWorld[i2], &matView); D3DXMatrixMultiply(&matWorldViewProjection[i2], &matWorldView[i2], &matProjection); D3DXMatrixInverse(&matWorldInverse[i2], NULL, &matWorld[i2]); D3DXMatrixTranspose(&matWorldInverseTransponse[i2], &matWorldInverse[i2]); } objects are then rendered like this: for(int i2=0; i2<numObjects; i2++){ //set variables for shader phong.Shader->SetMatrix("WorldXf", &matWorld[i2]); phong.Shader->SetMatrix("WorldITXf", &matWorldInverseTransponse[i2]); phong.Shader->SetMatrix("WvpXf", &matWorldViewProjection[i2]); for(DWORD i = 0; i < objects[i2].numMaterials; i++) { if(objects[i2].diffuse[i]!=NULL) phong.Shader->SetTexture("ColorTexture", objects[i2].diffuse[i]); if(objects[i2].specular[i]!=NULL) phong.Shader->SetTexture("SpecTexture", objects[i2].specular[i]); if(objects[i2].normal[i]!=NULL) phong.Shader->SetTexture("NormTexture", objects[i2].normal[i]); phong.Shader->CommitChanges(); objects[i2].DXObject->DrawSubset(i); } } The projection matrix is set with this: void PD_RENDERER::SetFOV(float FOV){ D3DXMATRIX matProjection; D3DXMatrixPerspectiveFovLH(&matProjection, pdDegree2Rad(FOV), (FLOAT)ScreenWidth / (FLOAT)ScreenHeight, 0.1f, 500.0f ); matProjection(2,2) = 1.0f; matProjection(3,2) = -1.0f; sys->Device->SetTransform(D3DTS_PROJECTION, &matProjection); } where float FOV defaults to 45 (which is what I use) [Edited by - JezzaP on May 29, 2009 1:06:18 AM]
  7. Hello. First post. I am writing a game engine in DX 9. I have had, for a long time, a strange problem where texture coordinates mess up when the camera gets close and views from an angle. The engine currently uses an effect file to render, but I am fairly sure the problem also existed before this, when I was using the fixed function pipeline. The problem exists not only when using textures, the lighting (such as which areas are lit the most by a point light) also messes up in the same way, even when textures are not used at all. The image on the left shows how it is meant to be, the right is what happens when one moves the camera close to the object. The object shown is a box generate by DirectX, but the problem also occurs when using meshes loaded in. I read somewhere this might have something to do with perspective correction. Thank you in advance for any suggestions. EDIT: does bbcode not work here? Anyway, direct link to image: http://img505.imageshack.us/img505/5202/probleme.jpg