V-sync and crispy textures

Started by
7 comments, last by cozzie 9 years, 8 months ago
Hi,
I've noticed something strange in my engine:

- v-sync on = all good
- v-sync off = lit textures look 'crispy' (sand like) when I move the camera
- turn it on again, still crispy

When I restart my application with v-sync enabled it's all good.

I update vsync realtime by:
- change present parameters (default vs intermediate)
- on lost device/ reset/ on reset device

Any idea what might be causing this?

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

Advertisement
Do you just have an extremely high frame-rate and it's just plain old screen tearing?

From my experience "crispy" textures usually comes from point filtering on texture samplers or disabled mip-mapping. Have you tried starting with vsync off? Something may be getting fubar'd during device reset.

Wouldn't grainy / crispy textures indicate a lack of mipmaps? Or maybe incorrect texture sampler settings?

[Edit] Oops, Voidmancer beat me to it.

If you take a screen shot with and without the crispy textures, do you see a difference in the still images? Perhaps you could post a before and after image, which would help to figure out what the issue is.

Do you just have an extremely high frame-rate and it's just plain old screen tearing?

Reenabling vsync still shows the problem, so I doubt it has to do with that.

I'd imagine it's some reinitialization oversight (if it's reinitializing the video hardware), otherwise I have no idea.

Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

As others have alluded too, it sounds like a mip-mapping issue, rather than an engine issue.

Have you created mipmaps for your entire image chain, and are you reloading them after each device lost/reset event?

Thanks for all pointers and replies.

I did some more testing and made some screenshots/ still images:

1. With v-sync

2. Without v-sync

3. Without v-sync at start (no switching)

It appears that results 1 and 3 are the same, so that probably means it doesn't have anything to do with V-sync.

Maybe something with the resetting of the device.

Below are the 3 screenshots and my reset code, what would you think?

With V-sync:

crisp_vsync.jpg

Without V-sync:

crisp_novsync.jpg

And without V-sync, at start (no switching):

crisp_novsync_atstart.jpg

Some code:


/**************************************************************************************/
/***									SET VSYNC									***/
/*** ==> usage: enables or desable vsync for d3d rendering							***/
/*** ==> updates the vsync bool in the d3d settings struct and resets the device	***/
/**************************************************************************************/

bool CD3d::SetVsync(const bool pVsync)
{
	if(mSettings.GetVsync() == pVsync) return false;
	
	mSettings.SetVsync(pVsync);
	if(mSettings.GetVsync()) mD3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;		// v-sync ON
	else mD3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;						// v-sync OFF

	OnLostDevice();

	while(!ResetDevice()) ResetDevice();
	
	OnResetDevice();
	return true;
}

// input handling routine

		if(_input.KeyPressed(VK_F4))																			// PRESSED
		{
			if(!_d3d.mSettings.GetVsync()) _d3d.SetVsync(true);
			else _d3d.SetVsync(false);
		}
		

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

Update: I found it, after resetting the device, I wasnt't 'resetting'/initializing my state machine.

So all d3d states (render, texture, sampler) were los and not recovered, all good now (probably texture filtering).

Thanks again for helping me in the right direction.

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

This topic is closed to new replies.

Advertisement