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

michaelmk86

Members
  • Content count

    44
  • Joined

  • Last visited

Community Reputation

189 Neutral

About michaelmk86

  • Rank
    Member
  1. The simplest way i can think of is this   ID3D11ShaderResourceView* textures[10]; for(int i=0; i<10; i++) D3DX11CreateShaderResourceViewFromFile(device, fileName[i], NULL, NULL, &textures[i], NULL); ID3D11DeviceContext* deviceContext; deviceContext->PSSetShaderResources(0, 10, textures); not sure if this is what you are asking.
  2. it is possible to pass to the shader a Texture Array and at the same time 2 or more Textures that are not in an arrey? I have try like that but it doesn't work deviceContext->PSSetShaderResources(0, 1, &ShadowMapTexture);//contains 1 Texture deviceContext->PSSetShaderResources(1, 1, &ReflectionTexture);//contains 1 Texture deviceContext->PSSetShaderResources(2, 4, modelTexturesArray);//contains 4 Textures //HLSL Texture2D Textures[6] : register(t0); Textures[0].Sample(.....// it is the ShadowMapTexture Textures[1].Sample(.....// it is the ReflectionTexture Textures[2].Sample(.....// it is the modelTexturesArray 0 Textures[3].Sample(.....// it is the modelTexturesArray 1 Textures[4].Sample(.....// it is the modelTexturesArray 2 Textures[5].Sample(.....// it is the modelTexturesArray 3 ... the weird thing is that if i do the following it works but not with the hadowMapTexture and ReflectionTexture at the same time deviceContext->PSSetShaderResources(0, 1, &ShadowMapTexture);//contains 1 Texture deviceContext->PSSetShaderResources(1, 4, modelTexturesArray);//contains 4 Textures //HLSL Texture2D Textures[5] : register(t0); Textures[0].Sample(.....// it is the ShadowMapTexture Textures[1].Sample(.....// it is the modelTexturesArray 0 Textures[2].Sample(.....// it is the modelTexturesArray 1 Textures[3].Sample(.....// it is the modelTexturesArray 2 Textures[4].Sample(.....// it is the modelTexturesArray 3 ...
  3. 2500 draw calls and 11fps looks reasonable if you have a very weak and old cpu.   just to give you an idea, if you have a good cpu you can make 40K draw calls with 60fps (but in DX11 not dx9)
  4. something weird that i notice struct VertexInputType { float4 position : POSITION; float2 tex : TEXCOORD0; float3 normal : NORMAL; uint material : BLENDINDICES; uint InstanceId : SV_InstanceID; };   in this line in the VertexShader   output.material = input.material;   have around 10% performance impact, I mean all it dose is to pass the an int to the Pixel Shader
  5. it works now.   with the "uint material : BLENDINDICES;" as input in the vertex shader   thanks
  6. that is exactly what I need, but can you give a bit more info on how to make this input to the shader?   //currently have this struct VertexInputType { float4 position : POSITION; float2 tex : TEXCOORD0; float3 normal : NORMAL; uint material; // what i need to put here? uint InstanceId : SV_InstanceID; };
  7. I solve my problem by doing the following:   std::wstring s2ws(const std::string& s) { int len; int slength = (int)s.length() + 1; len = MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, 0, 0); wchar_t* buf = new wchar_t[len]; MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, buf, len); std::wstring r(buf); delete[] buf; return r; } #ifdef UNICODE std::wstring stemp = s2ws(filename); // Temporary buffer is required LPCTSTR L_filename = stemp.c_str(); #else LPCTSTR L_filename = s.c_str(); #endif D3DX11CreateShaderResourceViewFromFile(device, L_filename, NULL, NULL, &texture, NULL); i just couldn't imagine such a simple thing to be that complicated.  
  8. to pass a string  in the second parameter here  WCHAR* filename = L"file path..."; D3DX11CreateShaderResourceViewFromFile(device, filename, NULL, NULL, &texture, NULL);
  9. I don't understand, the above code it giving me an error.   basically what i want is something like this WCHAR convert(std::string s) { WCHAR w; //do whatever needs to be done return w; } std::string s = "something"; WCHAR w = convert(s);
  10. I am trying to do this: std::string s; WCHAR w = s; Also what do you mean what platform i am using?
  11. Hi, how to get multiple textures on a model without the need to use separate draw calls for each texture that is on the model?   SamplerState SampleTypeWrap : register(s0); Texture2D mTexture0 : register(t0); Texture2D mTexture1 : register(t1); Texture2D mTexture2 : register(t2); struct PixelInputType { float4 position : SV_POSITION; float2 tex : TEXCOORD0; // contains texture coordinates for all 3 Textures that are on the model float3 normal : NORMAL; }; float4 PPixelShader(PixelInputType input) : SV_TARGET { //need to fine how to determine what Textures(mTexture0, mTexture1, mTexture2) corresponds to the input.tex (that contains all the texture coordinates) float4 output; //if(this pixel have Texture mTexture0) output = mTexture0.Sample(SampleTypeWrap, input.tex); //if(this pixel have Texture mTexture1) output = mTexture1.Sample(SampleTypeWrap, input.tex); //if(this pixel have Texture mTexture2) output = mTexture2.Sample(SampleTypeWrap, input.tex); return output; }   I hope i make myself clear.
  12. DX11

    looks like  passing the rotation with TEXCOORD is not possible. using an  array of matrices (inside constant buffer) and index it using SV_InstanceID works with rotation, but it can only pass 1024 matrix meaning i can only have 1024 instances of the same model. looking at the DirectX SDK(Direct3D10 folder, Instancing10) i find that is doing Instancing with this  "row_major float4x4 mTransform : mTransform;" but i have idea how to use this in dx11, in order to get  Instance with rotation and in large numbers like 10k not just 1024.   any ideals?
  13. DX11

    you mean like that ? struct VertexInputType { float4 position : POSITION; float2 tex : TEXCOORD0; matrix instancePosition; }; and in what way should I modify the D3D11_INPUT_ELEMENT_DESC ? polygonLayout[2].SemanticName = "TEXCOORD"; polygonLayout[2].SemanticIndex = 1; polygonLayout[2].Format = DXGI_FORMAT_R32G32B32_FLOAT; polygonLayout[2].InputSlot = 1; polygonLayout[2].AlignedByteOffset = 0; polygonLayout[2].InputSlotClass = D3D11_INPUT_PER_INSTANCE_DATA; polygonLayout[2].InstanceDataStepRate = 1;