rohit.gonsalves_ Posted June 23, 2016 Share Posted June 23, 2016 Hi There... I have created one custom App. Created the DirectX11 Device and context. I haven't created any swap chain as there is no windows where I want to render. I have created TextureRenderer and Texture. Using it for rendering viewport on this render target texture. m_pTextureRender = TextureRender::create(); m_pTextureRender->create2D(_dwWidth,_dwHeight); m_pTexture = Texture::create(); m_pTexture->create2D(_dwWidth,_dwHeight,Texture::FORMAT_RGB8,Texture::USAGE_RENDER); m_pTextureDS = Texture::create(); m_pTextureDS->create2D(_dwWidth,_dwHeight,Texture::FORMAT_D24,Texture::USAGE_RENDER); In CFG file I have loaded one world. <item name="console_command" type="string">world_load samples/animation/animation_00</item> Console shows that world is loading fine. Then I am acquiring game player and setting the matrices and render it. const char* post_materials = ""; Render *render = Render::get(); Game *game = Game::get(); PlayerPtr playerCam = game->getPlayer(); mat4 proj = playerCam->getProjection(); mat4 mv = playerCam->getModelview(); m_pTextureRender->setColorTexture(0,m_pTexture); m_pTextureRender->enable(); render->renderViewport(proj, mv, post_materials, m_iViewportMask, m_iReflectionMask, m_iUseShadows); m_pTextureRender->flush(); m_pTextureRender->disable(); if( _saveimage ) { ImagePtr img = Image::create(); m_pTexture->getImage(img); img->save("C://image.png",0.85f); } But now the rendering is black. Why it is not capturing the world? What could be the issue? Please advise. Rohit Link to comment
silent Posted June 23, 2016 Share Posted June 23, 2016 Hi Rohit, Could you please send us your test project so we can check the whole code and understand better what is going on? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
rohit.gonsalves_ Posted June 23, 2016 Author Share Posted June 23, 2016 Guess What... I have changed the Viewport mask to 1 and its working..... Able to get the result. The next step is to use the GPU texture in my application. This could be tricky now.... @silent: Tomorrow I will post the code here... Rohit Link to comment
rohit.gonsalves_ Posted December 5, 2016 Author Share Posted December 5, 2016 My Engine is integrated with Unigine Output. Wonderful.. One GPU.. Initialized with Our engine.. DX11 Device and Context. Same is used to initialize the Unigine. Now unigine output is shared on GPU with DX11 API with Our engine and Bingo... Runs smooth,. The next step is to take few DX11 textures from Our engine and map them to Unigine for further processing. One GPU two things... Excellent... Link to comment
Recommended Posts