Jump to content
  • Advertisement
Sign in to follow this  
Quinnie

(Pixel) Shaders

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

I have just read some introducing articles about Shaders, in specific Pixel Shaders... I was interested in using this feauture in combination with DirectX to be able to use Multitexturing with Alpha Blending... Now as far as I knwo it is possible to achieve this using Pixel Shaders... Now my question is: Is it normal to create your own shader or should/could I just use premade shaders? Now I have almost no experience with shaders, and as almost all people in the world a bit short in time :D Do you have any advice? p.s. The reason for Multitexture Alpha Blending is that im making an terrain generator that should use multitextexturing and being able to blend multiple (10-15) diferent types of texturing... p.s. I'm now using Multipass Single=Texturing but that is rather slow. And using Multi-Texturing in a single pass would be hardware dependent on the amount of Texture passes that the videocard supports. For more information, please ask any questions... Thanks in advance,

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Quinnie
Is it normal to create your own shader or should/could I just use premade shaders?

That's like asking if it's normal to write your own C++ code or use pre-made code. I'd say it depends on whether you find suitable code. :)

Quote:
p.s. I'm now using Multipass Single=Texturing but that is rather slow. And using Multi-Texturing in a single pass would be hardware dependent on the amount of Texture passes that the videocard supports.

Shader support would also be hardware dependent. Shader model 2 and up supports up to 16 textures. Older shader models support a lot less.

Share this post


Link to post
Share on other sites
The best advice I can give you is to understand the theory behind what the vertex and pixel processing stages of the pipeline do. This is well documented in the DirectX SDK Documentation. This will give you a better understanding on how to implement shaders. In addition to that, you could probably take a look at the HLSL tutorials on www.mdxinfo.com even if you are using unmanaged code. It should push you into the right direction I believe.

I hope this helps.
Take care.

Share this post


Link to post
Share on other sites
First of all, Thanks for your reply''s

Most of the time I do write C++ myself so than I will try creating my own shader... Thanks for that link it seems very helpfull although I am using unmanged code...

Is using shaders for multitexturing and aplha blending them the best solution or should I stick with normal Multi Texturing? Wich method is faster?

Thanks in advance,

Share this post


Link to post
Share on other sites
As everything else, it depends :)
In this case, it depends on the target hardware. You should try to use shaders on hardware that supports it, singlepass multitexturing on hardware that supports that but now shaders, and as a last fallback, multipass blending.
Or well, hardware that doesn't support singlepass multitexturing basically doesn't exist today, so supporting it is far from necessary, and unless you're making a commercial application that has to support almost every obscure device out there, you should just stick to shaders, but make shaders for older shadermodels.

Share this post


Link to post
Share on other sites

It isn't always the fastest solution according to some documentation to do all the multitexturing passes in 1 pass, even if it is possible.

Using pixel shaders with terrain splatting has the advantage that you can pack 4 alpha maps in a single texture and I think that it faster than using 4 separate alpha maps.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!