Welcome, Guest.
Username: Password: Remember me

TOPIC: simple question

simple question 1 year 7 months ago #1

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!
The administrator has disabled public write access.

simple question 1 year 7 months ago #2

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2438
  • Thank you received: 1387
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.
Cheers, crosire =)
The administrator has disabled public write access.
The following user(s) said Thank You: againstallathority