Sign in to follow this  
oxygen728

Simple FVF - Triangle Strip - What kind of render states do I need to set?

Recommended Posts

Thanks in advance for your time. Here's my FVF: #define SIMPLE_FVF (D3DFVF_XYZ|D3DFVF_DIFFUSE) Do I need lighting for this? What kind of render states do I need to set to get this viewable and pretty? I've got my vertices all setup with colors - but I'm confused about which render states to use. Thanks

Share this post


Link to post
Share on other sites
Heya Oxygen,

That's a pretty common FVF. It tells me your vertex data has just an x,y, and z coordinate in 3-space, and a color value.

For something this simple you don’t need any render states that I can recall. And you definitely DO NOT want lighting enabled. If you enable lighting your model will appear black, because you have no normal vectors with which to compute the effect of the light on the vertices. So make sure you keep lights off until you provide normals.

Beyond that, its all optional until you decide which "features" you want on the model or device as a whole. Finally, you do need a view and projection matrix, but I'm assuming you knew that already.

If you have any other specific questions don’t hesitate to ask.

Cheers!

Share this post


Link to post
Share on other sites
Yeah I think the render state must be all set by default to some values that will fit your needs. Though, if you're new to directx, you might want to experiment with some basic render, just as you understand and visualize what their effects and purposes are:

- D3DRS_ZENABLE
- D3DRS_FILLMODE
- D3DRS_CULLMODE

Then you can also play a bit with transparency which you can easily modify in you vertices' color (which has the form of a DWORd like 0xAARRGGBB). And try playing with every D3DRS_ALPHA***

And when eventually you will add normals to you vertices, try LIGHTING stuff, SHADEMODE stuff.

I hope you'll have fun :)

Share this post


Link to post
Share on other sites
Quote:
Original post by jwalsh
And you definitely DO NOT want lighting enabled. If you enable lighting your model will appear black, because you have no normal vectors with which to compute the effect of the light on the vertices.


Ahh.. it's all coming back to me now =) It's been a couple years since I've messed around with this stuff =)

Quote:
Yeah I think the render state must be all set by default to some values that will fit your needs. Though, if you're new to directx, you might want to experiment with some basic render, just as you understand and visualize what their effects and purposes are:

- D3DRS_ZENABLE
- D3DRS_FILLMODE
- D3DRS_CULLMODE

Then you can also play a bit with transparency which you can easily modify in you vertices' color (which has the form of a DWORd like 0xAARRGGBB). And try playing with every D3DRS_ALPHA***

And when eventually you will add normals to you vertices, try LIGHTING stuff, SHADEMODE stuff.


Thanks for the tips - I'll play around with that stuff and become familiar with it again.



Much appreciated!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this