Jump to content

  • Log In with Google      Sign In   
  • Create Account

mind in a box

Member Since 20 Apr 2010
Offline Last Active Oct 21 2016 09:48 AM

#5233223 Half-texel offset in DirectX 11 to fix a "blurry" image

Posted by on 06 June 2015 - 03:24 PM

Thanks for the thread, didn't even knew I had this problem as well in my engine! Text is so much better now :)

#5228260 Particle Distortion Effect

Posted by on 10 May 2015 - 02:27 PM

I am actually the one who made and uploaded the video. The world is small wink.png


The Effect in the video is archived by doing exactly what Eric Rufelt suggested: Have the backbuffer accessable in a shader and write it to another rendertarget by applying a small modification of the UV-Coords of that pixel. You can try with a static texture first.


For the particles I used another buffer to accumulate the displacement-vectors from the different particles (Using MRTs). I'm using the center of the particles and the luminosity of the texture to calculate the displacement-vector. This is then written to my distortion-buffer using additive blending, which gives a nice effect without the need of normalmaps or similar textures, since the game doesn't supply those


You should try to get the distortion-effect running for something simpler first without many overlaying triangles first. This makes things really easier.

#5107513 How to make object always face upward ?

Posted by on 06 November 2013 - 01:50 PM

Simplest way of doing this would be taking the cross-product of the world-up-vector (or whatever direction you want it to turn to) and your planes up vector.

Multiply that with the deltaTime and a strength factor (I use 500 for example) and apply that as torque to the plane.


I hope this will work well for your problem.

#4888407 [DX11] Rendering to multiple windows

Posted by on 28 November 2011 - 07:26 AM

I'll give you the keyword: "Swapchains".

When you create one, it gets attached to a window and gives you a rendertarget for that window, which you can simply set and render to as you would do usually.

#4885923 overhead of wrapper struct

Posted by on 20 November 2011 - 12:19 PM

Also, I'm not sure how to do in depth profiling. Currently I'm just measuring the amount of time taken for a certian part of the program using QueryPerformanceCounter

Try some code analysis-tool like "VerySleepy". It will tell you where the most time in your application is spend.

#4876775 Win32 Client Area Problem

Posted by on 25 October 2011 - 09:09 AM

My desktop resolution is 1366x768, so is this stopping my 1024x768 window from being created with the requested size?

Exactly this. Try to resize any window larger than this. Just put some window half outside the screen and then try to drag the border to the other side.
It will stop when the windows size has reached your resolution.

You can create your window with the WS_POPUP style to have a window without borders which can fill out the whole screen resolution. Or, if you are using DirectX or something your can create a fullscreen swapchain.

#4864777 [DirectX11] Color addition problem in shaders

Posted by on 22 September 2011 - 11:54 AM

Probably you should be using this to initialize your floats:

float4 Color = float4(0.1f, 0.1f, 0.1f, 1.0f);
(Notice the second "float4" in front of the brackets)

#4859066 DirectX11 DXUT11 GUI Showing french character

Posted by on 08 September 2011 - 09:03 AM

Someone made a cool little library that uses Direct2D/DirectWrite to render glyphs but for the life of me I cannot remember what it was called, or how to find it. That would probably be a much better place to start.

Here you go: http://fw1.codeplex.com/

#4847922 Ambient occlusion simulation for AAA projects

Posted by on 11 August 2011 - 03:12 PM

What it changes if i'll do photorealistic demo and developers ignore that the same way as now?

If your technique really works as you described and at the same quality you have shown, and even at a decent speed, then you created something awesome, indeed.

Can't you simply publish a paper and send this to some of the companies?
Wouldn't it be nice to have a few projects listened at the bottom where it has been used already?
Maybe some cool indie-game catches it up and those AAA-Devs get so see it in action just in time?

I've been monitoring this thread since your very first post. But I do not get your point.

Are you afraid that someone makes your technique "better" than you got it?
Think of the Crysis' SSAO. Everybody knows that this was the first in-game implementation, even though there are so many more now.

What it changes if i'll do photorealistic demo and developers ignore that the same way as now?

Who said that all developers ignore you? They're just angry because you're saying pretty much this to them:
"I have that awesome tech, but I won't tell you little guys how it works :)"

That makes the interested people kind of angry, don't you think?

#4833721 can a mipmap texture be bound to render target

Posted by on 11 July 2011 - 07:33 AM

uh, it works. I just think it's inconvenient. So I'm wondering if D3D10 support setting a level of a mipmap texture as render target. That will be very convenient.

Well, I just told you how to create that rendertargetview...

#4832019 Why Did All My Programs Minimize At Once?

Posted by on 06 July 2011 - 05:40 PM

Probably you're long dogging "Wut7" where hard catting one wut space pipes all the others?

#4824811 [XNA] [HLSL] Ambient light doesn't mix with point lighting

Posted by on 18 June 2011 - 09:15 AM

Edit: I should have read TiagoCosta's posting more properly. Damn :)

If you enabled blending and you are running the shadercode you posted on a normal scene-mesh you may get problems with your lighting texture.

You can give this a try:
output.Colour.rgb = tex2D(colorSampler, input.TextureCoordinates).rgb * (AmbientLight.rgb + tex2D(lightSampler, input.TextureCoordinates).rgb);
output.Colour.a = 1;

#4819541 seamless blur

Posted by on 04 June 2011 - 03:51 PM

In my Gaussian Blur I use for Blooming I have a parameter called "Deviation". Most Gaussian- If you put this higher, the effect gets wider. It won't give the best quality for blooming (Gets Box-Shaped), but since you want to blur a whole image one should only barely see any difference.

Here's my code in case you didn't implement that parameter:
HRESULT PostFXBase::GetSampleOffsets_Bloom(DWORD dwD3DTexSize,
                                            	float afTexCoordOffset[15],
                                            	float* avColorWeight,
                                            	float fDeviation, float fMultiplier )
	int i=0;
	float tu = 1.0f / (float)dwD3DTexSize;

	// Fill the center texel
	float weight = 1.0f * GaussianDistribution( 0, 0, fDeviation );
	avColorWeight[7] =  weight;

	afTexCoordOffset[7] = 0.0f;
	// Fill the right side
	for( i=1; i < 8; i++ )
    	weight = fMultiplier * GaussianDistribution( (float)i, 0, fDeviation );
    	afTexCoordOffset[7-i] = i * tu;

    	avColorWeight[7-i] = weight;

	// Copy to the left side
	for( i=8; i < 15; i++ )
    	avColorWeight[i] = avColorWeight[14-i];
    	afTexCoordOffset[i] = -afTexCoordOffset[14-i];

	return S_OK;

float PostFXBase::GaussianDistribution( float x, float y, float rho )
	float g = 1.0f / sqrtf( 2.0f * D3DX_PI * rho * rho );
	g *= expf( -(x*x + y*y)/(2*rho*rho) );

	return g;

#4811473 DX11 and compatibility with "old" graphic cards

Posted by on 16 May 2011 - 09:55 AM

The Samples in the DirectX SDK don't specify the feature level 9, they use either 10, 10.1 or 11.

You should try to modify the sample so that it uses feature level 9. You can't simply change the 11 to a 9, you'll also have to modify some of the code, like the shader model of the loaded shaders.
Of course you can't use things like the shader model 4 or 5, or some other D3D10 or 11 features.

But if you use only the features available to D3D9 it should run just as fine as it ran with a D3D9-Card, even though you are using the D3D11 API.

Your best bet at maintaining compatibility with these old cards is to leave in the DX9 renderer.

You only need to leave in the D3D9-Renderer when you want compatibility with Windows XP. For everything else you can use the feature-levels.

#4770364 Jailbreaking iPod touch 4

Posted by on 06 February 2011 - 05:29 AM

I've Jailbroken a few iPods/iPhones so far, so I can may answer some of your questions.

1. If you are lucky there is a jailbreak available for 4.2.1. All what you have to do is to google it.

2. If you use RedSn0w to jailbreak it you will have to completely restore your iPod with the Jailbroken firmware. AFAIK there was a tool called blackra1n which could to the jailbreak without loosing any of the data, but it was only available for version 3.x. Also there is a website called Jailbreakme.com for version 4.0 which you could open directly from your device. But those won't work with newer firmwares, so you have to restore it.
Maybe you can save your data somehow.

3.Don't know.

4. The only problem you will have is indeed if Apple releases an update. You can either leave your jailbroken older firmware on your device, or wait for the new one to be able to jailbreak and then restore your device again with it.

Hope that helps!