-
-
Notifications
You must be signed in to change notification settings - Fork 393
Warp/composite mesh U/V coordinates cause issues with some preset shaders #724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Note this isn't directly related to issue #725. While the other issue fixed some now superfluous negations in the u/v coordinates of the warp mesh, the issue here still remains unsolved. |
@dpw13 has identified the issue to be undocumented, undefined and unexpected behavior in HLSL, causing some math functions like pow, sqrt and log to produce results even with negative input values, which - according to the HLSL documentation - should return Dane is fixing it in the hlslparser by adding |
The following intrinsics have a limited domain where their output is defined and meaningful. Documentation for both HLSL shader model 3 and GLSL say that the output of By creating a shader that plots the output of these intrinsics, we can easily verify the behavior of each intrinsic. Here are the presets I used to plot these intrinsics. The R+G channels plot the unmodified intrinsic. The B channel plots the modified function to be used in projectM. If the plot has no yellow or blue regions, these functions overlap perfectly. The functions include:
The trigonometric functions are not perfect, but qualitatively mimic the shader model 3 implementation until the actual function can be found: |
There still are issues here and there, but the major part is done. Anything else, we'll fix over time - that is, if it's possible. |
After the renderer rewrite, some presets still do not render properly, leaving parts or the whole the image black. A few presets where this is quite obvious are:
The reason for this is that some presets use U/V coordinates in the exponent part of the
pow()
function, which is not allowed to be negative. Since texture coordinates - at least in OpenGL - can be negative, this will cause the result to becomeNaN
, breaking any subsequent calculations on the value. It might affect other presets as well, not causing clearly visible back areas but other less obvious artifacts as the values may not be in the range expetected by the preset author.One possible fix might be to wrap the U/V coordinates in the warp mesh vertex shader to always be in the range [0...1[.
The text was updated successfully, but these errors were encountered: