• 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

100 Neutral

About AlexErshov

  • Rank
  1. Hi, I have found my mistake. I used wrong format for vertex buffer layout: [CODE] D3D11_INPUT_ELEMENT_DESC layout[] = { { "POSITION", 0, DXGI_FORMAT_B8G8R8A8_UNORM, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 }, }; [/CODE] But have to use: [CODE] D3D11_INPUT_ELEMENT_DESC layout[] = { { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 }, }; [/CODE]
  2. I have changed D3D10Scene.h: [CODE] // D3D10Scene.h #pragma once #include <windows.h> // C RunTime Header Files #include <stdlib.h> #include <stdio.h> #include "d3d9.h" #include "d3dx9.h" #include "D3D10_1.h" #include "d3dx10.h" #include "d3dx11.h" #include "D3D11.h" using namespace System; struct float3 { float x; float y; float z; float3() {}; float3(float px, float py, float pz) { x=px;y=py;z=pz; } }; struct Vertex { float3 pos; Vertex(float x, float y, float z) {pos = float3(x,y,z);} }; ID3D11Buffer* VertexBuffer = NULL; ID3D11VertexShader* VS = NULL; ID3D11PixelShader* PS = NULL; ID3D10Blob* VS_Buffer = NULL; ID3D10Blob* PS_Buffer = NULL; ID3D11InputLayout* vertLayout = NULL; D3D11_INPUT_ELEMENT_DESC layout[] = { { "POSITION", 0, DXGI_FORMAT_B8G8R8A8_UNORM, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 }, }; UINT numElements = ARRAYSIZE(layout); IntPtr wpfHWND; namespace D3D10Scene { public ref class D3D10TestScene { public: D3D10TestScene() { WIDTH = 640; HEIGHT = 480; count = 0; InitializeDirect3d11App(); InitScene(); SetViews(); } bool InitializeDirect3d11App() { HRESULT hr; D3D_FEATURE_LEVEL *pFeatureLevel; pin_ptr<ID3D11Device*> g_DevicePtr = &g_Device; pin_ptr<ID3D11DeviceContext*> g_DeviceContextPtr = &g_DeviceContext; hr = D3D11CreateDevice(NULL , D3D_DRIVER_TYPE_HARDWARE , NULL , NULL , NULL , NULL , D3D11_SDK_VERSION , g_DevicePtr , pFeatureLevel , g_DeviceContextPtr); if(FAILED(hr)) { MessageBox(NULL, "Error creating Device", "Error", MB_OK | MB_ICONERROR); return false; } return true; } bool InitScene() { HRESULT hr; D3D11_VIEWPORT viewport; ZeroMemory(&viewport, sizeof(D3D11_VIEWPORT)); viewport.TopLeftX = 0; viewport.TopLeftY = 0; viewport.Width = WIDTH; viewport.Height = HEIGHT; g_DeviceContext->RSSetViewports(1, &viewport); hr = D3DX11CompileFromFile("Effects.fx", 0, 0, "VS", "vs_4_0", 0, 0, 0, &VS_Buffer, 0, 0); if(FAILED(hr)) { MessageBox(NULL, "Error compiling vertex shader", "Error", MB_OK | MB_ICONERROR); return false; } hr = D3DX11CompileFromFile("Effects.fx", 0, 0, "PS", "ps_4_0", 0, 0, 0, &PS_Buffer, 0, 0); if(FAILED(hr)) { MessageBox(NULL, "Error compiling pixel shader", "Error", MB_OK | MB_ICONERROR); return false; } hr = g_Device->CreateVertexShader(VS_Buffer->GetBufferPointer(), VS_Buffer->GetBufferSize(), NULL, &VS); if(FAILED(hr)) { MessageBox(NULL, "Error creating vertex shader", "Error", MB_OK | MB_ICONERROR); return false; } hr = g_Device->CreatePixelShader(PS_Buffer->GetBufferPointer(), PS_Buffer->GetBufferSize(), NULL, &PS); if(FAILED(hr)) { MessageBox(NULL, "Error creating pixel shader", "Error", MB_OK | MB_ICONERROR); return false; } g_DeviceContext->VSSetShader(VS, 0, 0); g_DeviceContext->PSSetShader(PS, 0, 0); Vertex v[] = { Vertex( 0.0f, 0.5f, 0.5f ), Vertex( 0.5f, -0.5f, 0.5f ), Vertex( -0.5f, -0.5f, 0.5f ), }; D3D11_BUFFER_DESC vertexBufferDesc; ZeroMemory( &vertexBufferDesc, sizeof(vertexBufferDesc) ); vertexBufferDesc.Usage = D3D11_USAGE_DEFAULT; vertexBufferDesc.ByteWidth = sizeof( Vertex ) * 3; vertexBufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; vertexBufferDesc.CPUAccessFlags = 0; vertexBufferDesc.MiscFlags = 0; D3D11_SUBRESOURCE_DATA vertexBufferData; ZeroMemory( &vertexBufferData, sizeof(vertexBufferData) ); vertexBufferData.pSysMem = v; hr = g_Device->CreateBuffer( &vertexBufferDesc, &vertexBufferData, &VertexBuffer); if(FAILED(hr)) { MessageBox(NULL, "Error creating buffer", "Error", MB_OK | MB_ICONERROR); return false; } UINT stride = sizeof( Vertex ); UINT offset = 0; g_DeviceContext->IASetVertexBuffers( 0, 1, &VertexBuffer, &stride, &offset ); g_Device->CreateInputLayout( layout, numElements, VS_Buffer->GetBufferPointer(), VS_Buffer->GetBufferSize(), &vertLayout ); g_DeviceContext->IASetInputLayout( vertLayout ); g_DeviceContext->IASetPrimitiveTopology( D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST ); return true; } IntPtr GetRenderTarget() { return IntPtr(g_Texture2D11); } void Render() { ID3D11RenderTargetView* pRenderTargetView; HRESULT hr = S_OK; hr = g_Device->CreateRenderTargetView(g_Texture2D11, NULL, &pRenderTargetView); g_DeviceContext->OMSetRenderTargets(1, &pRenderTargetView, NULL); //g_RenderTargetView = pRenderTargetView; float bgColor[4] = {0.0f, 0.0f, 0.0f, 0.0f}; g_DeviceContext->ClearRenderTargetView(pRenderTargetView, bgColor); g_DeviceContext->Draw( 3, 0 ); //g_SwapChain->Present(0, 0); g_DeviceContext->OMSetRenderTargets(0, 0, 0); pRenderTargetView->Release(); g_DeviceContext->Flush(); //count+=10; } ID3D11Texture2D* g_Texture2D11; ID3D11Device* g_Device; ID3D11DeviceContext* g_DeviceContext; UINT WIDTH; UINT HEIGHT; int count; private: HRESULT SetViews() { ID3D11Texture2D* pTexture = NULL; D3D11_TEXTURE2D_DESC Desc; Desc.Width = WIDTH; Desc.Height = HEIGHT; Desc.MipLevels = 1; Desc.ArraySize = 1; Desc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; Desc.SampleDesc.Count = 1; Desc.SampleDesc.Quality = 0; Desc.Usage = D3D11_USAGE_DEFAULT; Desc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE; Desc.CPUAccessFlags = 0; Desc.MiscFlags = D3D11_RESOURCE_MISC_SHARED; HRESULT hr = g_Device->CreateTexture2D(&Desc, NULL, &pTexture); g_Texture2D11 = pTexture; return S_OK; } }; } [/CODE] File Effects.fx: [CODE] float4 VS(float4 inPos : POSITION) : SV_POSITION { return inPos; } float4 PS() : SV_TARGET { return float4(0.0f, 0.75f, 1.0f, 1.0f); } [/CODE] And Window1.xaml.cs file: m_d3DImageEx.SetBackBufferEx(D3DResourceTypeEx.[b]ID3D11Texture2D[/b], m_d3D10Scene.GetRenderTarget()); That's all. Now I can see two buttons. But don't see triangle. Could you please provide your version of code ?
  3. I want to use DirectX 11 from unmanaged C++ code and use WFP for the GUI. SlimDX is not suitable for me. I have found the solution to make working WPF with DirectX 10: [url="http://jmorrill.hjtcentral.com/Home/tabid/428/EntryId/437/Direct3D-10-11-Direct2D-in-WPF.aspx"]WPF & DirectX 10 via D3DImage[/url] But I couldn't manage to work it with DirectX 11. Just blank screen with two buttons. Does anybody know how to make WPF working with DirectX 11. Also I had seen that when I'm just running this example the CPU usage is about 4-5% for Intel i5 750 (Windows 7 64 bit, NVidia Geforce 430). I think it's too much.. Is it possible to decrease CPU usage ?
  4. I am newbie in shader programming. I have found the following shader [url="http://developer.download.nvidia.com/shaderlibrary/packages/post_glowBalloon.zip"]http://developer.download.nvidia.com/shaderlibrary/packages/post_glowBalloon.zip[/url] But I don't know how to play with it. How can I see it in action ?