Open Fubaxiusz opened 9 months ago
You can define a uniform matrix variable in your effect with a custom source and add a binding at the matrix offset for it (you can then select that variable under "Add variable binding" with the offset you see in the editor), REST will then feed it into that variable
Like so: uniform float4x4 fov < source = "MY_FOV"; >;
, but you can also use just use a float if you need a singular value
Hi, great addon.
I have found binding to the vertical FOV value in the vertex shader Constant binding tab. It is encoded in the projection matrix (https://ogldev.org/www/tutorial12/tutorial12.html) and can be extracted to the FOV with the following formula:
90°=2*atan(1/0.5625 * 9/16)
, where 0.5625 is the matrix value, and 9/16 is to convert it to in-menu (see background) 90° vertical FOV, from horizontal matrix's FOV.How do I use that value inside a shader like PerfectPerspective.fx?