Jump to content
  • Advertisement
Sign in to follow this  
deffer

Multiple streams and vertex declaration

This topic is 5462 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. Gosh, I was searching out DXSDK documentation and even MSDN at microsoft.com, but I failed, eventually. So the deal is, I want to put POSITION, NORMAL, TEXCOORDS in one stream, and DIFFUSE, SPECULAR in another stream. Then draw a primitive, with proper settings from SetTextureStageState(..). The D3DX examples only shows that with vertex declarations, documentation also do not show any another way, so - let it be. But any examples focus on using shaders, which I'm not gonna use(GeForce2). I was experimenting a little(a lot?) with this, but all I was ending up with was D3DERR_INVALIDCALL... Is it possible, to combine vertex declaration with SetTextureStageState, skipping shaders at all? Is there a way not to use vertex declarations, only FVF? Has anybody been trying to do this before, and had some results(or is sure, that is it impossible)? Help... /def

Share this post


Link to post
Share on other sites
Advertisement
Vertex declarations can be used with the fixed function pipeline as well as well as with the programmable pipeline. You can peruse this link for more information.

Magius

Share this post


Link to post
Share on other sites
Hm...
And the question is: how?
I was already digging out the MSDN and there was no precise info, which I would gladly appreciate.

/def

Share this post


Link to post
Share on other sites
That sounds reasonable. It seems that I just missed setting vertex-shader-function to NULL and that's all.
I'll just go home and check that out.
(full of hope)

Thanks.
/def

Share this post


Link to post
Share on other sites
There's always the possibility that GeForce2 cards don't support multiple streams (I don't think they do, actually. I used one about 3 or 4 years back and I think streams were a no-no.)

SetTextureStageState is pretty much the same thing as pixel shaders.

The vertex declaration or FVF describes the input the vertex processing (fixed or vertex shader based).

The processing vertex method shouldn't require anything special of the input data, and the pixel processing definately doesn't require anything special about the input data. The FVF is like a special vertex declaration that implies a certain data order and stream 0.


FVF or
Declaration-----|
| |-Fixed Vertex Pipe-| |--TextureStageStates-|
Vertex Streams--+-+ +--+ +-Fog, AlphaTest, StencilTests, AlphaBlend, Write Pixel
| |-Vertex Shader-----| |--Pixel Shader-------|
Index Streams---|

Share this post


Link to post
Share on other sites
Check your caps...

D3DCAPS9::MaxStreams - Will be between 1 and 16, telling you the maximum number of streams the driver supports... if it's 0 then your driver isn't a DX9 compatible... if it's 1, you're out of luck. If it's 2 or more, then that isn't the problem.

Might want to seriously consider getting a new video card, too ;)

Share this post


Link to post
Share on other sites
And the winner is:

SetVertexDeclaration(pVertDecl);
SetVertexShader(NULL); // that was missing, strange days...
SetStreamSource(0, pVBuf0);
SetStreamSource(1, pVBuf1);
//...and just draw, draw and draw.

It all works just fine by now.

Quote:

Might want to seriously consider getting a new video card, too


Neah, newer graphic cards(from GeForce FX) require 16x AGP on motherboard. Which I do not have. Changing the motherboard would require new processor, and new RAM, DDR. It's like whole new machine.
I just can't afford it for now...

Cheers.
/def

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!