Jump to content

  • Log In with Google      Sign In   
  • Create Account

kolarz3

Member Since 10 Jun 2013
Offline Last Active Jun 26 2014 07:33 AM

Topics I've Started

Visual 2013 problem with debugging shader

31 May 2014 - 10:11 AM

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

 


3D Engine to analysis

29 April 2014 - 05:43 AM

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.


Problem with loading data to 2D Texture

02 March 2014 - 05:21 AM

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

 

 


Problem with creating "blanc" ID3D11Texture2D

16 February 2014 - 04:09 PM

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: 

qrer.png

 

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;
}

Texture atlas generation for popular format

22 August 2013 - 11:37 AM

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.


PARTNERS