Jump to content
  • Advertisement
Sign in to follow this  
Live0les

Bloom...Explosions....Glow....[XNA]

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

Hello, thanks for paying attention to my post here =)

I am searching for some tutorials for 2D Shaders, and i post a post here and someone (THANKS!) answered me, but I still can't understand part of it... I think is most of it...
Is the value of texcoord 0-1 refers to the screen 0-1 or the texels?
How do pixel shaders handle pixels? one by one (inputting different values to the function for many times) or compute it altogether? (i think one by one is more reasonable...)
If I want to make effects like bloom (2D) distortion glow etc. what should i do?
in XNA, even when I didn't apply a Pass, the effect of that pass occurs also, and ignored the other pass(I have applied the ignored pass but didn't apply the used pass)...
Thanks for all the helps!

(Sorry for my english...)

Share this post


Link to post
Share on other sites
Advertisement
A 2D texture is basically a 2D array of texels (texture pixels). So the texture coordinates are used to know which texel should be sampled (For example a (0.25, 0.5) texture coordinate in a 256x256 texture would correspond to the texel at position (64, 128)) Texture coordinates range from 0-1 because this way any texture size can be used (in the example about if the texture size was 512x512 the texel sampled would be (256, 128)).

The pixel shader is ran once per pixel and each pixel shader call only calculates one pixel color.

If you want to apply effects like bloom you're looking for fullscreen effects, that is you render a quad covering the whole screen so the pixel shader is called once per pixel on screen (despite some pixel overdraw that may occur but dont worry about it.

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!