simple question

  • againstallathority
  • againstallathority's Avatar Topic Author
  • Offline
More
5 years 4 months ago #1 by againstallathority
simple question was created by againstallathority
found this equation in main reshade.fx file in vertex:
	OUT.txcoord.x = (IN.id == 2) ? 2.0 : 0.0;
	OUT.txcoord.y = (IN.id == 1) ? 2.0 : 0.0;
	OUT.vpos = float4(OUT.txcoord * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0);

can you, guys, explain me what we are doing here? why we check vertex ID in postprocess? i assume its always same quad - the output screen...
each line commend will be apreciated!

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

More
5 years 4 months ago #2 by crosire
Replied by crosire on topic simple question
Here's a full explanation: www.reddit.com/r/gamedev/comments/2j17wk...vertex_shader_trick/

ReShade doesn't provide any positions etc. to the shaders, it simply renders a single triangle, what you do with that triangle and where you put it is your choice and done in the vertex shader.
The following user(s) said Thank You: againstallathority

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