The vertex shader ...

  • Zonesystem
  • Topic Author
More
9 years 1 month ago #1 by Zonesystem The vertex shader ... was created by Zonesystem
Hi,

I am rather curious about the 'standard' implementation of the vertexshader, the one that seems to produce 1 of three fixed points { (-1,1), (-1,-3) or (3,1) } depending on the vertex id. Why is it like that and how do the pixel shaders following it seem to be written to expect the texture coordinates spanning the entire screen actually get these texture coordinates, rather then just one of the three the vertex shader produces?

Or is this vertex shader just a placeholder?

I am no graphics programmer, but I have written a filter or two in HLSL for Virtualdub's gpushader plugin. I was hoping to write a 'shader' to enlarge a part of the view, namely the tiny icons of the target effect monitor in Guildwars 2.

Please Log in or Create an account to join the conversation.

  • crosire
More
9 years 1 month ago #2 by crosire Replied by crosire on topic The vertex shader ...
All values you output in the vertex shader are interpolated before sent to the pixel shader (unless you add "nointerpolation" to the output parameter). The screen is defined to be between -1 and +1 in both x and y direction, so the example vertex shader creates a triangle that is bigger than the screen, filling it out. The values are chosen in a way that the interpolated texture coordinates on this triangle exactly match the desired 0 to 1 range on the visible screen range.
The following user(s) said Thank You: Zonesystem

Please Log in or Create an account to join the conversation.

  • Zonesystem
  • Topic Author
More
9 years 1 month ago #3 by Zonesystem Replied by Zonesystem on topic The vertex shader ...
I understand a little bit more now, thank you.

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.