• Create Account

### #Actuallipsryme

Posted 27 April 2013 - 07:25 AM

Well I've managed to get the rendering done (but using 6 passes) now...

How do I combine these 6 RenderTargets to a single CubeMap ShaderResource ?

Is there any way to do that using each RT's ID3D11Texture* ?

edit:

I tried something like:

	ID3D11Texture2D* cubeFaces[6];
for(unsigned int i = 0; i < 6; i++)
{
this->faces[i] = new CustomRenderTarget(this->device, DXGI_FORMAT_R8G8B8A8_UNORM, this->size, this->size);
cubeFaces[i] = this->faces[i]->GetRenderTargetTexture();
}

D3D11_SUBRESOURCE_DATA subData;
subData.pSysMem = cubeFaces;
subData.SysMemPitch = sizeof(XMFLOAT4) * this->size;

ID3D11Texture2D* cubeMap = NULL;
D3D11_TEXTURE2D_DESC texDesc;
texDesc.Width = this->size;
texDesc.Height = this->size;
texDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
texDesc.MipLevels = 0;
texDesc.ArraySize = 6;
texDesc.SampleDesc.Count = 1;
texDesc.Usage = D3D11_USAGE_DEFAULT;
texDesc.SampleDesc.Quality = 0;
texDesc.CPUAccessFlags = 0;
texDesc.MiscFlags = D3D11_RESOURCE_MISC_TEXTURECUBE;

HRESULT hr = this->device->CreateTexture2D(&texDesc, &subData, &cubeMap);



But I'm getting an error on the last line saying Invalid arguments.

### #3lipsryme

Posted 27 April 2013 - 07:04 AM

Well I've managed to get the rendering done (but using 6 passes) now...

How do I combine these 6 RenderTargets to a single CubeMap ShaderResource ?

Is there any way to do that using each RT's ID3D11Texture* ?

### #2lipsryme

Posted 27 April 2013 - 06:29 AM

Well I've managed to get the rendering done (but using 6 passes) now...

How do I combine these 6 RenderTargets to a single CubeMap ShaderResource ?

Is there any way to do that using each RT's ID3D11Texture* ?

And do I have to do anything different when creating this per frame for dynamic cubemaps ?

### #1lipsryme

Posted 27 April 2013 - 06:17 AM

Well I've managed to get the rendering done (but using 6 passes) now...

How do I combine these 6 RenderTargets to a single CubeMap ShaderResource ?

Is there any way to do that using each RT's ID3D11Texture* ?

PARTNERS