-
-
Notifications
You must be signed in to change notification settings - Fork 773
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
Differences in texture blending with ShaderGenerator vs. fixed-function pipeline #189
Comments
Thanks for the comprehensive test case! I've fixed this now for the cases you described. |
Thank you for the fixes! It is indeed working quite well now, except for one (hopefully last) remaining difference: any combine mode using CS_constant_color_scale as one of its sources still gives a different result; see e.g. example 4 I gave earlier:
The M_blend_color_scale mode does work correctly now, but perhaps the combine source was overlooked? Apart from this, do you think it's worth investigating the alpha combine modes as well, or is it safe to assume that a correctly working rgb combine mode guarantees that the corresponding alpha combine mode works correctly also? |
After editing the code sample to take alpha into account, it looks like the FFP ignores alpha when setting the mode of either or both texture stages to |
In short, the problematic settings seem to be the following:
while CM_dot3_rgb and CM_dot3_rgba raise an assertion error:
AssertionError: shader != nullptr at line 1565 of c:\buildslave\sdk-windows-i386\build\panda\src\pgraphnodes\shaderGenerator.cxx
Here are some example settings that cause different results when using the ShaderGenerator, compared to those when using the fixed-function pipeline; you can test these settings with the code sample given below.
stage 1: M_modulate
stage 2: M_blend_color_scale with color scale white
stage 1: M_modulate
stage 2: M_add with color scale (1., .3, .1, 1.)
stage 1: M_modulate
stage 2: CM_subtract, CS_texture, CO_src_color, CS_previous, CO_src_color
stage 1: M_modulate
stage 2: CM_interpolate, CS_texture, CO_src_color, CS_previous, CO_src_color, CS_previous, CO_src_color
stage 1: M_modulate
stage 2: CM_modulate, CS_constant_color_scale, CO_src_color, CS_previous, CO_src_color
stage 1: M_modulate
stage 2: CM_modulate, CS_texture, CO_one_minus_src_color, CS_previous, CO_src_color
stage 1: M_add
stage 2: CM_modulate, CS_previous, CO_src_color, CS_texture, CO_one_minus_src_color
stage 1: M_modulate
stage 2: CM_add_signed, CS_texture, CO_src_color, CS_previous, CO_src_color
stage 2 rgb scale: 2
Here is a code sample that should allow for easy testing of the various combinations of blending modes, combine modes, sources and operands:
Testing was done using version 0343dbc of Panda3D on Windows 10 64-bit.
The text was updated successfully, but these errors were encountered: