-
Notifications
You must be signed in to change notification settings - Fork 80
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
[F3D] Material Overflow Preview Fix #313
Conversation
…tension to C input to color combiner
to be clear,
means "clamping into the [0, 1] range happens for values in range [-0.5, 1.5), values outside are not clamped properly" right? (not sure on the specifics of "not clamped properly")
can you clarify what is fast64 nodes behavior and what is hardware behavior here |
I am trying to review this, currently trying to make a test blend, but I stumbled upon
If you have a test blend already it'd be appreciated |
Values are coming out of the combiner have a special sign extension and clamp happening at those values, you can see that from AL source here with the definition of the clamp here. So this means the output has values clamped to [0-1), with the overflow happening on [-0.5, 1.5). Anything [1-1.5) = 1, anything [-0.5-0] = 0.
I'll just go over this in steps. First the actual N64:
For Fast64 both cycles use the same nodes, so the formula is as follows:
|
You get the rendering bug when you feed a combined input of 256 into C input. It then undergoes normal sign extension and becomes negative. You can get a value of 256 by using 1.0 on the 1st cycle combiner. So a 1st cycle value of 1, or (1-prim)*tex+prim, tex+prim etc. will result in a value of 256 output. Just anything where a value between 1-1.5 can be input into C. |
has conflicts |
I messed up with my git history woops. Remade the branch |
Fixed the way overflow works on the color combiner.
On 2 cycle, the combiner doesn't actually do the special sign extension [-0.5, 1.5) on the first cycle's output unless it is for alpha compare, but since this will feed into inputs which are getting special sign extension on hardware it replicates the behavior properly.
This will come after #312