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

kolarz3

Members
  • Content count

    37
  • Joined

  • Last visited

Community Reputation

164 Neutral

About kolarz3

  • Rank
    Member
  1. Hello guys, I try to use brakepoint in my shader file but visual tell me that he didnt see file with flags to debuging. I comppile shader with: D3DCompile(buffer.data(), buffer.size(), NULL, NULL, NULL, mainFucName, "ps_5_0", D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION, NULL, &PS_Buffer, &errorPS); In hlsl proporties in both shaders is enable debugging information and shader verision is 5_0. Project: http://www.dropbox.com/s/0wgbjqdxgvi2g1o/DirectXTest.rar  
  2. I need this engine to learning, I have't any special project. Very important for me is source code editor to learn more about architecture and relationship between engine and editor. I'm searching engine like Unity3D but not soooo large. Maybe like this: http://www.maratis3d.org/?p=343. It would be best if engine will be only for windows and written on DirectX 11 or 10.Do you have any suggestions?
  3. I searching for 3D engine with editor (engine and editor source code free ). This engine should be easy and I'd be good if project is on vs2010 and DirectX 11.
  4. Hello, I have the same problem that is in topic :). I have array with unsigned char "RGBABufor". I map this data to ID3D11Texture2D (only 20 sciles). When I try save this texture i have HRESULT : Unspecified error ID3D11Texture2D *defaultTex; D3D11_TEXTURE2D_DESC desc; ZeroMemory( &desc, sizeof(desc)); desc.Width = clip->getWidth(); desc.Height = 20; desc.MipLevels = desc.ArraySize = 1; desc.Format = DXGI_FORMAT_R8G8B8A8_UINT; desc.SampleDesc.Count = 1; desc.Usage = D3D11_USAGE_DYNAMIC; desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; engine.d3d11Device->CreateTexture2D( &desc, NULL, &defaultTex ); D3D11_MAPPED_SUBRESOURCE mapResource; engine.d3d11DevCon->Map(defaultTex,0,D3D11_MAP_WRITE_DISCARD,0,&mapResource); BYTE* mappedData = reinterpret_cast<BYTE*>(mapResource.pData); memcpy(mappedData,RGBABufor, clip->getWidth()*20*4); engine.d3d11DevCon->Unmap(defaultTex, 0); hr=D3DX11SaveTextureToFile(engine.d3d11DevCon,defaultTex,D3DX11_IFF_PNG,L"obraz.png"); This is fragment of "mappedData", 3 pixels: ùùùÿùùùÿùùùÿ This looks good. Where is problem ... ?    
  5. bool ModelData::createDefaultMaterial() { struct Pix { float r,g,b,a; }; Pix* img; img=new Pix[256*256]; for(int y=0;y<256;y++)for(int x=0;x<256;x++){img[y*256+x].r=1.0;img[y*256+x].g=0.0;img[y*256+x].b=0.0;img[y*256+x].a=1.0;} D3D11_TEXTURE2D_DESC desc; ZeroMemory( &desc, sizeof(desc)); desc.Width = 256; desc.Height = 256; desc.MipLevels = desc.ArraySize = 1; desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; desc.SampleDesc.Count = 1; desc.Usage = D3D11_USAGE_DYNAMIC; desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; ID3D11Texture2D *pTexture = NULL; engine.d3d11Device->CreateTexture2D( &desc, NULL, &pTexture ); D3D11_MAPPED_SUBRESOURCE mapResource; engine.d3d11DevCon->Map(pTexture,0,D3D11_MAP_WRITE_DISCARD,0,&mapResource); BYTE* mappedData = reinterpret_cast<BYTE*>(mapResource.pData); memcpy(mappedData, img, 256*256*4*sizeof(float)); engine.d3d11DevCon->Unmap(pTexture, 0); D3DX11SaveTextureToFile(engine.d3d11DevCon,pTexture,D3DX11_IFF_PNG,L"nazwaa.png"); return TRUE; } Problem is solved. I must change Format to DXGI_FORMAT_R32G32B32A32_FLOAT
  6. Hello, i try to generate texture progrmically. Everything looks good, but when I save texture to file I'm disappointed. I expected red texture but i got this:    Code: bool ModelData::createDefaultMaterial() { struct Pix { float r,g,b,a; }; Pix* img; img=new Pix[256*256]; for(int y=0;y<128;y++)for(int x=0;x<256;x++){img[y*256+x].r=1.0;img[y*256+x].g=0.0;img[y*256+x].b=0.0;img[y*256+x].a=1.0;} D3D11_TEXTURE2D_DESC desc; ZeroMemory( &desc, sizeof(desc)); desc.Width = 256; desc.Height = 256; desc.MipLevels = desc.ArraySize = 1; desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; desc.SampleDesc.Count = 1; desc.Usage = D3D11_USAGE_DYNAMIC; desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; ID3D11Texture2D *pTexture = NULL; engine.d3d11Device->CreateTexture2D( &desc, NULL, &pTexture ); D3D11_MAPPED_SUBRESOURCE mapResource; engine.d3d11DevCon->Map(pTexture,0,D3D11_MAP_WRITE_DISCARD,0,&mapResource); BYTE* mappedData = reinterpret_cast<BYTE*>(mapResource.pData); memcpy(mappedData, img, 256*256*4); engine.d3d11DevCon->Unmap(pTexture, 0); D3DX11SaveTextureToFile(engine.d3d11DevCon,pTexture,D3DX11_IFF_PNG,L"nazwaa.png"); return TRUE; }
  7. I didnt see any texture adds in DirectX SDK. I have 2010 version. But I'd like program that also load mesh and change UV cords. 
  8. I download 3d model from free website. But thay have multi texture. I want to link this into one texture(and I would't want have problem with mipmap). How can I this generate? Almost I use 3ds or obj format.
  9. Helo guys, I try to turn on opacity texture. In close model look good, but in the distance I see artifacts. Maybe mipmaps help ? I try to turn on this mipmap but I dont known that this work ? This is clip on yt : http://www.youtube.com/watch?v=cfvxJ8dGHaQ. D3DX11_IMAGE_LOAD_INFO info; //ZeroMemory( &info, sizeof(info) ); info.BindFlags= D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE; info.MiscFlags=D3D11_RESOURCE_MISC_GENERATE_MIPS; info.MipLevels=D3DX11_DEFAULT ; D3DX11CreateShaderResourceViewFromFile( d3d11Device,sw,&info, NULL, &texture, NULL );//diffuse D3DX11CreateShaderResourceViewFromFile( d3d11Device,sw,&info, NULL, &texture2, NULL );/opacity D3D11_SAMPLER_DESC sampDesc; ZeroMemory( &sampDesc, sizeof(sampDesc) ); sampDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; sampDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP; sampDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP; sampDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP; sampDesc.ComparisonFunc = D3D11_COMPARISON_NEVER; sampDesc.MinLOD = 0; sampDesc.MaxLOD = D3D11_FLOAT32_MAX; d3d11Device->CreateSamplerState( &sampDesc, &CubesTexSamplerState );//sampler state of textures //This call per frame d3d11DevCon->GenerateMips(texture); d3d11DevCon->GenerateMips(texture2); //PS fragment if(opacity.Sample( ObjSamplerState, input.UVcord ).x>=0.5)psOut.Color=diffuse.Sample( ObjSamplerState, input.UVcord ); else clip(psOut.Color.a-1.1);
  10. Anyway "Color* obj = (Color*)mapResource.pData;" do the same that "memcpy(obj, mapResource.pData,mapResource.RowPitch*Height);"
  11. But in this case we must to cast data from D3D11_MAPPED_SUBRESOURCE to BYTE.
  12. Now everything work.I found also thet all rows of pixel have extra 4 pixel data(I dont known what they mean) . If anybody later searching for solution I put code . void Pick(ID3D11Texture2D* texture) { ID3D11Texture2D* textureBuf; D3D11_TEXTURE2D_DESC textureDesc; ZeroMemory(&textureDesc, sizeof(textureDesc)); textureDesc.Width = Width; textureDesc.Height = Height; textureDesc.MipLevels = 1; textureDesc.ArraySize = 1; textureDesc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; textureDesc.SampleDesc.Count = 1; textureDesc.SampleDesc.Quality = 0; textureDesc.Usage = D3D11_USAGE_STAGING; textureDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; textureDesc.MiscFlags = 0; d3d11Device->CreateTexture2D(&textureDesc, NULL, &textureBuf); d3d11DevCon->CopyResource(textureBuf,texture); D3D11_MAPPED_SUBRESOURCE mapResource; hr=d3d11DevCon->Map(textureBuf,0,D3D11_MAP_READ,NULL,&mapResource); struct Color {float r, g, b, a;}; Color* obj; obj=new Color[(mapResource.RowPitch/sizeof(Color))*Height]; memcpy(obj, mapResource.pData,mapResource.RowPitch*Height); if(mousePos.x>0&&mousePos.x<Width&&mousePos.y>0&&mousePos.y<Height) if(obj[(mousePos.y*Width)+(4*mousePos.y)+mousePos.x].r==1.0/*If object that we was pick mouse have 1.0 on red bit we draw little cloud*/)model.rysujOtoczk?(model.dolny,model.gorny); d3d11DevCon->Unmap(textureBuf,0); textureBuf->Release(); delete [] obj; }
  13. I dont known why i cant move pointer of my structer. Any solution ? struct Color { float r, g, b, a; }; Color* obj; obj=new Color[mapResource.RowPitch*Height]; BYTE* mappedData = reinterpret_cast<BYTE*>(mapResource.pData); for(UINT i = 0; i < Height; ++i) { memcpy(obj, mappedData, mapResource.RowPitch); mappedData += mapResource.RowPitch; obj += mapResource.RowPitch;//without this line program work }
  14. I cant copy anything because debuger stop on memcpy, if I continue debuging visual jump into memcpy.asm file : rep movsd ;N - move all of our dwords memcpy(obj,mapResource.pData,mapResource.RowPitch); Edit: I forget to allocate memory/
  15. Now work(with copying with "obj=(Color *)mapResource.pData;"), but I don't known why I cant copy with memcpy. How can I copy this data with memcpy? memcpy ( obj,mapResource.pData, sizeof(Color) );