Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your feedback on a survey! Each completed response supports our community and gives you a chance to win a $25 Amazon gift card!


Directx10


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
5 replies to this topic

#1 null434   Members   -  Reputation: 133

Like
0Likes
Like

Posted 12 September 2013 - 01:33 PM

Can I make points displayed on screen without technique and effect like directx 9? If so, what is the way to do that?



Sponsor:

#2 Migi0027   Crossbones+   -  Reputation: 2137

Like
0Likes
Like

Posted 12 September 2013 - 01:40 PM

Do you mean draw on each individual pixel?

 

Or sprites (2D Textures on screen)? (Great Open Source, http://directxtk.codeplex.com/)

 

If you mean actually rendering a mesh, then you'll need to create a shader, which is relatively similar to the effects framework. http://msdn.microsoft.com/en-us/library/windows/desktop/bb509703(v=vs.85).aspx

 

-MIGI0027


Hi! Cuboid Zone
The Rule: Be polite, be professional, but have a plan to steal all their shaders!

#3 null434   Members   -  Reputation: 133

Like
0Likes
Like

Posted 12 September 2013 - 01:48 PM

I have set up one input layout and one vertex buffer that contains only three vertices. I wonder if i can only use that to draw the three vertices on the screen without using shader. I didn't declare ID3D10Effect or ID3D10EffectTechnique..



#4 Washu   Senior Moderators   -  Reputation: 5639

Like
0Likes
Like

Posted 12 September 2013 - 01:49 PM

No, you need at least a basic shader to render anything in D3D10 and beyond. There is no fixed function pipeline anymore.


In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.
ScapeCode - Blog | SlimDX


#5 null434   Members   -  Reputation: 133

Like
0Likes
Like

Posted 12 September 2013 - 11:13 PM

Thanks for the replies. There's another quesiton.. I used FX Composer 2.5 to create a fx.file in which the shader code is following:

cbuffer cbObject
{
float4x4 gWVP;
};
 
void VS(float3 iPosL : POSITION,
             out float4 oPosH : SV_POSITION)
{
oPosH = mul(float4(iPosL, 1.0f), gWVP);
}
 
float4 PS(float4 oPosH : SV_POSITION) :SV_TARGET
 {
 return oPosH;
 }
 
technique10 ColorTech
{
pass PO
{
SetVertexShader( CompileShader( vs_4_0, VS() );
SetGeometryShader(NULL);
SetPixelShader(CompileShader( ps_4_0, PS() );
}
}
 
And I added the fx file in the Resource files. When I launched debugger, a series of errors appeared as following:
 
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(2): error C2146: syntax error : missing ';' before identifier 'cbObject'
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(2): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(2): error C2470: 'cbObject' : looks like a function definition, but there is no parameter list; skipping apparent body
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(6): error C2065: 'float3' : undeclared identifier
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(6): error C2146: syntax error : missing ')' before identifier 'iPosL'
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(6): error C2182: 'VS' : illegal use of type 'void'
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(6): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(7): error C2146: syntax error : missing ';' before identifier 'float4'
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(7): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(7): error C2146: syntax error : missing ';' before identifier 'oPosH'
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(7): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(7): error C2470: 'oPosH' : looks like a function definition, but there is no parameter list; skipping apparent body
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(7): error C2059: syntax error : ')'
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(8): error C2059: syntax error : '{'
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(11): error C2146: syntax error : missing ';' before identifier 'PS'
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(11): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(11): error C2086: 'int float4' : redefinition
1>          c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(7) : see declaration of 'float4'
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(11): error C2146: syntax error : missing ')' before identifier 'oPosH'
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(11): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(11): error C2059: syntax error : ')'
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(11): error C2470: 'SV_POSITION' : looks like a function definition, but there is no parameter list; skipping apparent body
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(12): error C2059: syntax error : '{'
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(17): error C2146: syntax error : missing ';' before identifier 'ColorTech'
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(17): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\peter\documents\visual studio 2010\projects\newpp\newpp\ew.fx(17): error C2470: 'ColorTech' : looks like a function definition, but there is no parameter list; skipping apparent body
 
Is it the problem that I integrated the fx file in the wrong way?


#6 Real_Noname   Members   -  Reputation: 276

Like
1Likes
Like

Posted 13 September 2013 - 01:09 AM

C++ is NOT C#!

 

You cannot add an FX files to resources and expect it to just work. You first need to compile your effect (trough cmd line tool or with D3DCompile) and then load it as a "Shader Resouce" - THEN you can load it to your device - everything must be coded!


//====== POWER IN CODE =======

// Homepage: http://en.coderulers.info





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