Jump to content

  • Log In with Google      Sign In   
  • Create Account


akira32

Member Since 17 Jul 2005
Offline Last Active Oct 16 2012 05:29 AM

Topics I've Started

Where can I download the source code of the book "GPU Pro"?

03 August 2012 - 11:36 AM

Where can I download the source code of the book "GPU Pro"?

I cannot download it at the website http://www.akpeters.com/gpupro/.

git commit problem

23 May 2012 - 09:22 PM

I saw this website as below.
https://devcenter.heroku.com/articles/facebook#create_an_app
I follow the steps until input the command of "git commit -am "changed greeting""
When I input the command, it appears the message as below:

E:\tmp\heroku\strong-planet-2902>git commit -am "changed greeting"
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	   index.php
nothing added to commit but untracked files present (use "git add" to track)


Does somebody know how to solve this problem?

XNA, draw a quad(full screen) with shader

31 December 2011 - 10:39 AM

I render a elephant into a render target and then use the render target to draw a quad(full screen).
But I can not use the quad in screen. I think that is rendering problem.

I also put my complete source code at: https://skydrive.liv...AFtjlRG9yqoz7d4
My quad max file: https://skydrive.liv...AMf6yH0lBxeac9E

My quad faces the position z axis and cullmode=none. In quad max file, the x is between -1 to +1, the y is between -1 to +1.
I put my shader code as below for rendering a full-screen quad:
Does somebody know how to solve this problem?

1 texture RenerTargetTexture  
2 <  
3 string ResourceName = "RT";  
4 string UIName = "RenerTargetTexture";  
5 string ResourceType = "Texture";  
6 >;  
7  
8 sampler2D RT = sampler_state  
9 {  
10	 Texture = <RenerTargetTexture>;  
11	 MinFilter = LINEAR;  
12	 MagFilter = LINEAR;  
13	 MipFilter = LINEAR;  
14 };  
15  
16 struct VS_OUTPUT  
17 {  
18	float4 Pos	  : POSITION;  
19	float2 TexCoord : TEXCOORD0;  
20 };  
21  
22 VS_OUTPUT vs_main( float4 inPos: POSITION, float2 inTexCoord: TEXCOORD0)  
23 {  
24	VS_OUTPUT Out=(VS_OUTPUT)0;  
25  
26	Out.Pos	   = float4(inPos.xy, 0.0, 1.0);  
27	Out.TexCoord.x = 0.5 * (1 + inPos.x);  
28	Out.TexCoord.y = 0.5 * (1 - inPos.y);  
29  
30	return Out;  
31 }  
32  
33 float4 ps_main( VS_OUTPUT input ) : COLOR  
34 {  
35	 float4 Color1 = tex2D(RT, input.TexCoord);  
36	 return Color1;  
37 }  
38  
39 technique Technique1  
40 {  
41	 pass Pass1  
42	 {		  
43		 VertexShader = compile vs_2_0 vs_main();  
44		 PixelShader = compile ps_2_0 ps_main();  
45  
46		 CullMode = none;  
47	 }  
48 }									   47							}											48							}			

In Draw function:

1				 GraphicsDevice.SetRenderTarget(m_RenderTarget1);  
2  
3				 GraphicsDevice.Clear(Color.Black);  
4				 m_ElephantModel.DrawWithEffect1(m_camera.view, m_camera.projection, m_effect_orginal_model);  
5				 GraphicsDevice.SetRenderTarget(null);  
6				  
7				 GraphicsDevice.Clear(Color.White);  
8				 m_QuadModel.DrawWithEffect2(null, m_effect_final_result);	

Even I change the shader code as below, I also cannot see any red pixel on the screen.
33 float4 ps_main( VS_OUTPUT input ) : COLOR
34 {
35 float4 Color1 = tex2D(RT, input.TexCoord);
36 return float4(1,0,0,1);
37 }

What is the vertex limit number of glDrawArrays?

22 October 2011 - 03:42 AM

What is the vertex limit number of glDrawArrays? Should I divide two parts when I want to draw the vertices over 65535?

XNA, rotation matrix association and YawPitchRoll

30 July 2011 - 07:43 AM


Matrix Rx = Matrix.CreateRotationX(MathHelper.PiOver2);   
Matrix 
Ry = Matrix.CreateRotationY(MathHelper.PiOver2);   
Matrix Rz = 
Matrix.CreateRotationZ(MathHelper.PiOver2);   
 
Matrix R1 
= Ry * Rx * Rz;
Matrix R2 = Matrix.CreateFromYawPitchRoll(MathHelper.PiOver2, 
MathHelper.PiOver2, MathHelper.PiOver2);


Does the rotation matrix have the association?
The R1 and R2 matrix are different. Even I change The R1 as Rx*Ry*Rz.

Another problem as below:
Rx(x1) * Ry(y1) * Rz(z1) * Rx(x2) * Ry(y2) * R(z2) = Rx(x1+x2)* Ry(y1+y2) * Rz(z1+z2)
assoicate rule is suitable for Rotation Matrix in Axis-x,Axis-y,Axis-z(Rx,Ry,Rz).
x1,y1,z1,x2,y2,z2 are euler angle. The equation is right or not?


PARTNERS