# Flashing,horizontal red stripes

This topic is 4518 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I tried to create a simple system that allows me to arrange renderpasses as a tree-like structure(shadowmap pass feeds it's renderTarget in all other passes for example). When i just render to the backbuffer everything works fine but after adding another pass which renders to a texture i get horizontal red lines flashing in front of my scene(so the scene gets rendered to the backbuffer). The texture of the render-to-texture-pass isn't used in any way. I think i had an error like this a while ago but i can't remember what it was caused by. Maybe somebody could jog my memory. PS: sadly i can't post screenshots as the stripes don't appear on them regards, m4gnus

##### Share on other sites
Are you sure its not magenta/pink stripes? The debug runtimes will insert alternating magenta/green screens when presenting uncleared buffers.

Have you checked the debug runtimes output (max output/validation)? If you've messed up a parameter thats consequently failing a call, thus leaving something in an invalid state it should show up in the debug output.

Also, do you get similar issues with the reference rasterizer?

hth
Jack

##### Share on other sites
yes they're more magenta than red.

Quote:
 Have you checked the debug runtimes output (max output/validation)? If you've messed up a parameter thats consequently failing a call, thus leaving something in an invalid state it should show up in the debug output.

yes i checked it but there's nothing strange in the debug spew.

but the magenta only appear when i create my device render with HAL(in REF the stripes are gone)

Quote:
 presenting uncleared buffers.

what buffers could that be?

regards,
m4gnus

##### Share on other sites
Quote:
Original post by m4gnus
Quote:
 presenting uncleared buffers.

what buffers could that be?
Usually the back-buffer, I'm don't think it'll also happen with render-targets. If you just keep looping through Present() calls it should alternate between bright green and bright pink - or go so fast that you get a fuzzy brown colour [smile]

Although, if it is this, then you should be seeing some green as well as magenta. I seem to remember there being other "codes" used by the debug runtime, but I dont think they're documented anywhere and I can't remember them off the top of my head [oh]

As a suggestion - run a full call-stream capture via PIX and then step through it, see if you can isolate where the problem lies. Capturing PIX via the HAL should yield the same results - just much slower...

hth
Jack

##### Share on other sites
i only get magenta stripes(at least i only notice the magenta ones).
I never used pix, i don't even know what exactly it does.

regards,
m4gnus

##### Share on other sites
wow pix rockz. I found some points in the run file that don't look right.
Just before calling device.Clear() i set 2 differenent renderTargets(there are 2 SetRenderTarget calls right before clear with 2 different values as the 2nd parameter) and clear is called with strange parameters: pix says Clear is calles like that: IDirect3DDevice9::Clear(0x000000000,NULL,0x00000000,D3DCOLOR_ARGB(0x00,0x00,0x00,0x00),0.00f,0x00000000)

which makes no sense to me as i'm clearing everything to D3DCOLOR_XRGB(50, 50, 100).

Maybe posting my render function helps:

void ngRenderPass::render(){	ngEngine &engine=ngEngine::getInstance();	//engine.g_pD3DDevice->SetRenderTarget(0,*backbuffer);   //set the backbuffer as renderTarget		pcam->update();	float aspect;		if(isEnd) //check if this is the last pass(the pass that finally renders to the backbuffer)	{		aspect=engine.getRes().x/engine.getRes().y;		engine.g_pD3DDevice->SetRenderTarget(0,*engine.getBackBuffer());	}else 	{		aspect=1.0f;		LPDIRECT3DSURFACE9 target= *outTextures[0].getD3DSurface();		engine.g_pD3DDevice->SetRenderTarget(0,target);	}	engine.g_pD3DDevice->Clear(NULL,NULL,D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,D3DCOLOR_XRGB(50, 50, 100),1.0f,0);	pcam->createProjMatrix(aspect);	engine.g_pD3DDevice->BeginScene();	int matSize=matChanges.size();	int mtrxSize=matrixChanges.size();	for(std::vector<matChange>::iterator matIt=matChanges.begin();matIt!=matChanges.end();++matIt)	{		ngMaterial *mat=matIt->mat;		LPD3DXEFFECT effect=mat->getEffect();		for(std::vector<matrixChange>::iterator mtrxIt=matIt->startMatrix;mtrxIt!=matIt->endMatrix;++mtrxIt)		{						int size;			D3DXHANDLE *passTextureHandles=mat->getPassTextureHandles(&size);			for(int i=0;i<size;i++)				effect->SetTexture(passTextureHandles,inTextures->getD3DTexture());			effect->SetMatrix(mat->getWorldHandle(),mtrxIt->world);			effect->SetMatrix(mat->getViewHandle(),&pcam->getViewMatrix());			effect->SetMatrix(mat->getProjHandle(),&pcam->getProjMatrix());			effect->SetMatrix(mat->getAllHandle(),&((*(mtrxIt->world))*(pcam->getViewMatrix())*(pcam->getProjMatrix())));			unsigned int numPasses=mat->begin();			for(unsigned int pass=0;pass<numPasses;pass++)			{				mat->beginPass(i);								for(std::vector<CBaseMesh *>::iterator meIt=mtrxIt->startMesh;meIt!=mtrxIt->endMesh;++meIt)				{					Draw((**meIt).pVBuff,(**meIt).pIBuff);				}				mat->endPass();			}		}		engine.g_pD3DDevice->EndScene();		engine.g_pD3DDevice->Present(NULL,NULL,NULL,NULL);	}}

Edit: btw i tried taking a screenshot with pix and got a solid magenta image.

regards,
m4gnus

1. 1
2. 2
3. 3
Rutin
22
4. 4
frob
17
5. 5

• 33
• 13
• 12
• 10
• 12
• ### Forum Statistics

• Total Topics
632573
• Total Posts
3007143

×