Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ArnoAtWork

Apply materials(shaders)

This topic is 5504 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

To apply shaders on polygons, a good approach is to index a shader per polygon. This shader is defined with a VS, a texture, a PS. Using vertex or pixel shader, it''s really easy to map a file(.txt or compiled file) at each shader. When program loads, it just have to load each file and apply them on different material. But in my case, I have a GeForce2 and I can''t using PS, so I have to call "normal" functions to map texture, ... How can I implement a structure of material able to support vertex shader, opengl functions, d3d functions and maybe one day, pixel shader. Thanks a lot.

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by ArnoAtWork
How can I implement a structure of material able to support vertex shader, opengl functions, d3d functions and maybe one day, pixel shader.



Take a look at Nvidia''s CgFX and/or DirectX''s HLSL+effects.
Don''t roll your own.

Do you _really_ need to be cross-API compatible? It will cost you major PITA all along the way, with very little (frankly, I can see none) real advantage. Just make up your mind, pick one of the APIs and get working. There are numerous evidences that both are good enough :-)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!