Jump to content

  • Log In with Google      Sign In   
  • Create Account


Grayscale Image Transitions Using SlimDX


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
29 replies to this topic

#21 Yash14   Members   -  Reputation: 100

Like
0Likes
Like

Posted 24 June 2011 - 05:24 AM

can you please post some link where i can go and see a simple example for Pixel shader.

Sponsor:

#22 Yash14   Members   -  Reputation: 100

Like
0Likes
Like

Posted 24 June 2011 - 06:17 AM

Thanks a lot for your help. My simple pixel shader is now working.

#23 Yash14   Members   -  Reputation: 100

Like
0Likes
Like

Posted 27 June 2011 - 01:20 AM

As my pixel shader is giving a static effect and now I want to use it to give some effect. So for this I have to add a progress variable in my pixel shader and initialize to the Constant table function i.e
constantTable.SetValue(D3DDevice,"progress",progress );
I am having the problem in using this function for progress in my program. Anybody know how to set this variable in my program.

And my new pixel Shader code is

float progress : register(C0);
sampler2D implicitInput : register(s0);
sampler2D oldInput : register(s1);

struct VS_OUTPUT
{
    float4 Position  : POSITION;
    float4 Color     : COLOR0;
    float2 UV        : TEXCOORD0;
};

float4 Blinds(float2 uv)
{		
	if(frac(uv.y * 5) < progress)
	{
		return tex2D(implicitInput, uv);
	}
	else
	{
		return tex2D(oldInput, uv);
	}
}

//--------------------------------------------------------------------------------------
// Pixel Shader
//--------------------------------------------------------------------------------------
float4 main(VS_OUTPUT input) : COLOR0
{
	return Blinds(input.UV);
}




#24 janwayne2   Members   -  Reputation: 100

Like
0Likes
Like

Posted 05 July 2011 - 02:02 PM

Effect shader = Effect.FromFile(device, "shader.fx", ShaderFlags.None);

EffectHandle paramWorldViewProj = new EffectHandle("matWorldViewProj");

.. then at render time:...

// here is an example of setting a shader parameter...
shader.SetValue(paramWorldViewProj , worldViewProjection);

shader.Begin();
shader.BeginPass(0);

// primitives render call goes here
// model.Render();

shader.EndPass();
shader.End();



Hi Postie, I'm doing the same thing, but somehow can't get it to work. I have a question here, can you use SlimDX.Direct3D.Sprite to draw the textures between beginpass and endpass? Or should I use vertexes etc. At the moment I have everything working with just using Texture on Sprite (ofcourse without the PixelShader).

#25 Postie   Members   -  Reputation: 882

Like
0Likes
Like

Posted 05 July 2011 - 07:19 PM

I haven't really used Sprites, so can't give you a definitive answer, but my feeling is that it wouldn't work with the shader as I described.

I found this article on using Pixel Shaders with Sprites, but its for XNA, so you'll have to adapt the code somewhat: http://msdn.microsof...studio.31).aspx
Currently working on an open world survival RPG - For info check out my Development blog: ByteWrangler

#26 Yash14   Members   -  Reputation: 100

Like
0Likes
Like

Posted 11 July 2011 - 02:23 AM

My slimDX slide show is working fine except that is transitions are not moving smoothly when I am playing them in windowed mode but they are moving very smoothly when I am playing them in full screen mode.
Can anybody please tell me the reason behind this problem..

#27 Postie   Members   -  Reputation: 882

Like
1Likes
Like

Posted 11 July 2011 - 09:23 PM

It could be that your desktop colour depth isn't 32 bit. This would cause the brightness values to jump instead of smoothly transition.

Have at look at the image on the following site : http://www.lagom.nl/...st/gradient.php. Does it appear smooth or is there banding?
Currently working on an open world survival RPG - For info check out my Development blog: ByteWrangler

#28 Yash14   Members   -  Reputation: 100

Like
0Likes
Like

Posted 16 July 2011 - 04:11 AM

Its Not about the display of the image. My image is being displayed correctly but when I am moving my image through the (x,y) coordinates then it is giving jerks in the windowed mode but is is moving smoothly in the full screen mode.

And i am going through one more problem. I am trying to move text over my image slide show by the help of sprite and font.DrawString() method. The text is moving smoothly but when my texture is getting the next image from the listbox then the moving text stops for a while(for some milliseconds) till the next image is loaded in the texture. I am loding the texture by the help of Texture.fromfile() function. Kindly help me regarding this.

#29 Yash14   Members   -  Reputation: 100

Like
0Likes
Like

Posted 19 July 2011 - 02:47 AM

I have made a simple slide show using slimdx and is rendering a quad by the help of two triangles and I am using the high level shader language to do some image transitions. And is also rendering a text which is moving with respect of (x,y) coordinates but my project is using 94% of my graphic card. Can anyone tell me the reason.

#30 Yash14   Members   -  Reputation: 100

Like
0Likes
Like

Posted 21 July 2011 - 03:52 AM

Please help me out to sort out this problem




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS