Jump to content
  • Advertisement
Sign in to follow this  
Axiverse

Shader + Vertex Formats

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

How do you handle differences in the vertex data format/pixel datat format that the program wants and the shader wants? - I mean that you won't have a shader for every vertex format, and even with something as simple as one wants a format with one component removed. Do you provide a editing class that will overcome the differences with pointers/functons? or will you create another copy that complys with the what the shader wants and convert a chunk every time it is updated?

Share this post


Link to post
Share on other sites
Advertisement
Hi,

A shader doesn't ask for a particular format (at least with high level languages) but it requires a certain amount of information to be present.
for example if your shader as the semantics Position, Normal and Color0 it will not care if your format declares a Binormal and Tangent. These information will just be ignored. On the other hand if your vertex format lacks one of these the shader will not run.

Pixel shaders are pretty much color format agnostic. The output float4 of the pixel shader is clamped an quantized to the pixel format required just between the pixel shader's return and the blending operation.

Phil

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.

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

Sign me up!