Skip to content
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

T>hybrid color 2 does not work in openCL #685

Closed
mclarekin opened this issue Jul 14, 2019 · 18 comments
Closed

T>hybrid color 2 does not work in openCL #685

mclarekin opened this issue Jul 14, 2019 · 18 comments
Milestone

Comments

@mclarekin
Copy link
Collaborator

mclarekin commented Jul 14, 2019

# Mandelbulber settings file
# version 2.19
# only modified parameters
[main_parameters]
ambient_occlusion_enabled true;
camera 4.579669976578777e-15 -20.00000000000001 -3.330669073875471e-15;
camera_distance_to_target 20.00000000000001;
camera_rotation 0 0 0;
camera_top -1.369186070602273e-16 -1.110223024625157e-16 1;
constant_DE_threshold true;
flight_last_to_render 0;
formula_1 119;
formula_2 2001;
hybrid_fractal_enable true;
image_width 600;
keyframe_last_to_render 0;
mat1_coloring_palette_offset 0.821;
mat1_fractal_coloring_aux_color_false true;
mat1_fractal_coloring_aux_color_hybrid_weight 1;
mat1_fractal_coloring_aux_color_weight 0;
mat1_fractal_coloring_extra_color_enabled_false true;
mat1_fractal_coloring_orbit_trap_true false;
mat1_is_defined true;
mat1_metallic false;
mat1_specular 1;
mat1_specular_width 1;
raytraced_reflections true;
view_distance_max 80.95302307829314;
[fractal_1]
IFS_rotation_enabled true;
mandelbox_color 0.1 0.1 0.1;
mandelbox_color_Sp1 0;
mandelbox_color_Sp2 0;
[fractal_2]
IFS_rotation_enabled true;
info true;
transf_addition_constantA_000 6 -6 0;
transf_function_enabledAx_false true;
transf_function_enabledAy_false true;
transf_function_enabledAz_false true;
transf_function_enabledBx_false true;
transf_offset_000 -6 6 0;
transf_offsetA_000 6 6 0;
transf_offsetF_000 -6 -6 0;
transf_scaleA_1 0.3;
transf_scaleB_1 19.2;
transf_scaleD_1 4.4;
transf_start_iterations_T 15;
transf_stop_iterations_M 23;
transf_stop_iterations_T 25;
[fractal_3]
IFS_rotation_enabled true;
[fractal_4]
IFS_rotation_enabled true;
@mclarekin mclarekin added this to the 2.20 milestone Jul 14, 2019
@mclarekin
Copy link
Collaborator Author

mclarekin commented Nov 9, 2019

same with T>DIFS auxColor

# Mandelbulber settings file
# version 2.20
# only modified parameters
[main_parameters]
ambient_occlusion_enabled true;
ambient_occlusion_quality 10;
background_3_colors_enable false;
bailout 800;
camera 0.6486999062230647 -18.58090674956949 -0.2634878210784795;
camera_distance_to_target 18.20898058129644;
camera_rotation 4.750047429937577 -21.63282232851582 91.91363288932099;
camera_top 0.9970290738766789 0.07049456931211236 -0.0310409655473481;
check_for_bailout_1 false;
constant_DE_threshold true;
DE_factor 0.25;
DE_thresh 0.00125;
delta_DE_function 5;
flight_last_to_render 0;
fog_color_1 a400 d500 ef00;
fog_color_2 d700 eb00 ef00;
formula_1 1608;
formula_2 2002;
fov 0.4;
hybrid_fractal_enable true;
image_height 720;
image_proportion 4;
image_width 1280;
keyframe_last_to_render 0;
main_light_alpha 0;
main_light_beta 0;
mat1_fractal_coloring_aux_color_false true;
mat1_fractal_coloring_extra_color_enabled_false true;
mat1_fractal_coloring_orbit_trap_true false;
mat1_fractal_coloring_round_scale 7.7;
mat1_is_defined true;
mat1_specular_color c700 c700 c700;
mat1_specular_plastic_enable false;
mat1_surface_color_gradient 0 fd6029 1000 698403 2000 aa0000 3000 f5bd22 4000 000000 5000 1d5521 6000 a51c64 7000 3b9fee 8000 d4ffd4 9000 aba53c;
N 13;
raytraced_reflections true;
target -0.752962150081518 -1.712602488596151 -6.976358194411755;
view_distance_max 96.88938569762929;
volumetric_fog_density 0.25;
[fractal_1]
transf_offset_000 0 0 2;
transf_offsetA_1 0.5;
transf_stop_iterations_M 6;
[fractal_2]
fold_color_aux_color_enabled_false true;
fold_color_difs_0000 1 0 1 0;
info true;
transf_function_enabled_false true;
transf_function_enabledx_false true;
transf_offset_000 0 0 2.2;
transf_offset_1111 -0.6 1 1 1;
transf_offset_2222 1.8 2 2 2;
transf_offsetA_1 0.5;
transf_start_iterations 4;
transf_stop_iterations 12;
transf_stop_iterations_M 6;
[fractal_3]
transf_function_enabledAy_false true;
transf_offset_000 0 0 2.2;
transf_offset_0005 0.08;
transf_offset_001 0 0 0;
transf_offset_2222 1 1 2 2;
transf_offsetA_000 2 2.200000000000001 0;
transf_offsetA_1 0.5;
transf_offsetE_2 0;
transf_offsetF_2 0;
transf_rotation 0 0 45.458356;
transf_scale_2 0.9999999999999997;
transf_scaleA_0 1;
transf_scaleB_0 1;
transf_stop_iterations_M 6;

@buddhi1980
Copy link
Owner

What I see that it works properly when checkForBailoutCondition is disabled for t>hybridColoring
But I don't know why yet.

@mclarekin
Copy link
Collaborator Author

mclarekin commented Nov 13, 2019 via email

@mclarekin
Copy link
Collaborator Author

mclarekin commented Nov 15, 2019 via email

@mclarekin
Copy link
Collaborator Author

mclarekin commented Nov 24, 2019

There may be more than one issue. Here i am just using color by numbers.

But there seems to be a difference between iteration based color. I will recheck a few things tomorrow.

# Mandelbulber settings file
# version 2.20
# only modified parameters
[main_parameters]
ambient_occlusion_enabled true;
background_3_colors_enable false;
background_color_1 0000 aa00 ff00;
camera -5.073483504217775 -6.934375902948554 3.437892053324262;
camera_distance_to_target 3.735248565673828;
camera_rotation 0 0 0;
camera_top 0 0 1;
constant_DE_threshold true;
DE_factor 0.5;
DE_thresh 0.001112271707301139;
delta_DE_function 5;
dont_add_c_constant_2 true;
flight_last_to_render 0;
formula_1 2104;
formula_2 125;
formula_3 2104;
formula_iterations_2 7;
formula_stop_iteration_2 9;
fov 0.5;
fractal_enable_3 false;
glow_enabled false;
hybrid_fractal_enable true;
image_proportion 3;
image_width 900;
keyframe_last_to_render 0;
mat1_coloring_palette_offset 10.01;
mat1_fractal_coloring_extra_color_enabled_false true;
mat1_fractal_coloring_iter_group_enabled_false true;
mat1_fractal_coloring_orbit_trap_scale1 0;
mat1_fractal_coloring_orbit_trap_true false;
mat1_fractal_coloring_orbit_trap_weight 3.9;
mat1_fractal_coloring_rad_div_de_scale1 0;
mat1_fractal_coloring_rad_div_de_weight 19.5;
mat1_fractal_coloring_xyzC_111 0 0 1;
mat1_is_defined true;
mat1_specular 1;
mat1_specular_plastic_enable false;
mat1_specular_width 1;
mat1_surface_color 3600 5500 3300;
mat1_surface_color_gradient 0 fd6029 999 698403 1999 aa0000 2999 f5bd22 3999 0b5e87 5000 c68876 5999 00ffff 7000 3b9fee 7955 aa0000 9000 aba53c;
N 52;
raytraced_reflections true;
target -5.073483504217775 -3.199127337274727 3.437892053324262;
view_distance_max 168.117903318534;
volumetric_fog_colour_1_distance 0.03125;
volumetric_fog_colour_2_distance 0.0625;
volumetric_fog_density 0.125;
volumetric_fog_distance_factor 0.0625;
[fractal_1]
boxfold_bulbpow2_z_factor 1;
fold_color_difs1 0.9;
mandelbox_color 0 1.85 0;
mandelbox_color_Sp1 0;
mandelbox_main_rotation_enabled true;
mandelbox_scale 1.2;
transf_addition_constant 0 0 0.3;
transf_addition_constant_0555 1 1 1;
transf_folding_limit 0.9;
transf_function_enabled_false true;
transf_function_enabledAz_false true;
transf_function_enabledB_false true;
transf_function_enabledBx false;
transf_function_enabledBy false;
transf_function_enabledBy_false true;
transf_function_enabledD_false true;
transf_function_enabledK_false true;
transf_function_enabledM false;
transf_function_enabledM_false true;
transf_function_enabledz_false true;
transf_minimum_radius_05 0;
transf_minR2_p25 0;
transf_offset_001 0 0 1.7;
transf_offset_002 0 0 1.7;
transf_offset_05 0;
transf_offset_1 2;
transf_offset_111 1 1 3;
transf_offset_2 1;
transf_offsetA_0 1.2;
transf_offsetA_1 1.5;
transf_offsetA_2 1.2;
transf_offsetE_2 0.7;
transf_offsetF_2 1.2;
transf_scale_2 1.2;
[fractal_2]
fold_color_difs1 0.2;
mandelbox_color 0 0 0.07000000000000001;
mandelbox_color_Sp1 0;
mandelbox_color_Sp2 0;
mandelbox_main_rotation_enabled true;
mandelbox_scale 1.1;
transf_addition_constant 0 0 0.3;
transf_addition_constant_0555 1 1 1;
transf_folding_limit 0.9;
transf_function_enabledAz_false true;
transf_function_enabledBx false;
transf_function_enabledBy false;
transf_function_enabledBy_false true;
transf_function_enabledK_false true;
transf_function_enabledM false;
transf_function_enabledz_false true;
transf_minR2_p25 0;
transf_offset_001 0 0 3;
transf_offset_002 0 0 1.7;
transf_offset_05 0;
transf_offset_1 2;
transf_offset_111 1 1 3;
transf_offset_2 0.9999999999999997;
transf_offsetA_0 2.7;
transf_offsetA_1 1.5;
transf_offsetA_2 1.199999999999999;
transf_offsetB_0 2;
transf_scale_2 1.2;
transf_start_iterations_A 6;
transf_start_iterations_M 4;
transf_stop_iterations_A 7;
transf_stop_iterations_C 7;
transf_stop_iterations_X 7;
[fractal_3]
transf_function_enabledAx false;
transf_function_enabledAy false;
transf_function_enabledBz_false true;
transf_function_enabledG_false true;
transf_function_enabledM false;
transf_function_enabledR_false true;
transf_function_enabledSw_false true;
transf_function_enabledX_false true;
transf_offset_0005 0.01;
transf_radius_1 0.6;
transf_rotation 0 0 30;

@mclarekin
Copy link
Collaborator Author

mclarekin commented Nov 24, 2019

and here is openCL c++ diference with aux.color

# Mandelbulber settings file
# version 2.20
# only modified parameters
[main_parameters]
ambient_occlusion_enabled true;
background_3_colors_enable false;
background_color_1 0000 aa00 ff00;
camera -5.073483504217775 -6.934375902948554 3.437892053324262;
camera_distance_to_target 3.735248565673828;
camera_rotation 0 0 0;
camera_top 0 0 1;
constant_DE_threshold true;
DE_factor 0.5;
DE_thresh 0.001112271707301139;
delta_DE_function 5;
dont_add_c_constant_2 true;
flight_last_to_render 0;
formula_1 2104;
formula_2 125;
formula_3 2104;
formula_iterations_2 7;
formula_stop_iteration_2 9;
fov 0.5;
fractal_enable_3 false;
glow_enabled false;
hybrid_fractal_enable true;
image_proportion 3;
image_width 900;
keyframe_last_to_render 0;
mat1_coloring_palette_offset 10.01;
mat1_fractal_coloring_aux_color_false true;
mat1_fractal_coloring_extra_color_enabled_false true;
mat1_fractal_coloring_orbit_trap_scale1 0;
mat1_fractal_coloring_orbit_trap_true false;
mat1_fractal_coloring_orbit_trap_weight 3.9;
mat1_fractal_coloring_rad_div_de_scale1 0;
mat1_fractal_coloring_rad_div_de_weight 19.5;
mat1_fractal_coloring_xyzC_111 0 0 1;
mat1_is_defined true;
mat1_specular 1;
mat1_specular_plastic_enable false;
mat1_specular_width 1;
mat1_surface_color 3600 5500 3300;
mat1_surface_color_gradient 0 fd6029 999 698403 1999 aa0000 2999 f5bd22 3999 0b5e87 5000 c68876 5999 00ffff 7000 3b9fee 7955 aa0000 9000 aba53c;
N 52;
raytraced_reflections true;
target -5.073483504217775 -3.199127337274727 3.437892053324262;
view_distance_max 168.117903318534;
volumetric_fog_colour_1_distance 0.03125;
volumetric_fog_colour_2_distance 0.0625;
volumetric_fog_density 0.125;
volumetric_fog_distance_factor 0.0625;
[fractal_1]
boxfold_bulbpow2_z_factor 1;
fold_color_difs1 0.9;
mandelbox_color 0 1.85 0;
mandelbox_color_Sp1 0;
mandelbox_main_rotation_enabled true;
mandelbox_scale 1.2;
transf_addition_constant 0 0 0.3;
transf_addition_constant_0555 1 1 1;
transf_folding_limit 0.9;
transf_function_enabled_false true;
transf_function_enabledAz_false true;
transf_function_enabledB_false true;
transf_function_enabledBx false;
transf_function_enabledBy false;
transf_function_enabledBy_false true;
transf_function_enabledD_false true;
transf_function_enabledK_false true;
transf_function_enabledM false;
transf_function_enabledM_false true;
transf_function_enabledz_false true;
transf_minimum_radius_05 0;
transf_minR2_p25 0;
transf_offset_001 0 0 1.7;
transf_offset_002 0 0 1.7;
transf_offset_05 0;
transf_offset_1 2;
transf_offset_111 1 1 3;
transf_offset_2 1;
transf_offsetA_0 1.2;
transf_offsetA_1 1.5;
transf_offsetA_2 1.2;
transf_offsetE_2 0.7;
transf_offsetF_2 1.2;
transf_scale_2 1.2;
[fractal_2]
fold_color_difs1 0.2;
mandelbox_color 0 0 0.07000000000000001;
mandelbox_color_Sp1 0;
mandelbox_color_Sp2 0;
mandelbox_main_rotation_enabled true;
mandelbox_scale 1.1;
transf_addition_constant 0 0 0.3;
transf_addition_constant_0555 1 1 1;
transf_folding_limit 0.9;
transf_function_enabledAz_false true;
transf_function_enabledBx false;
transf_function_enabledBy false;
transf_function_enabledBy_false true;
transf_function_enabledK_false true;
transf_function_enabledM false;
transf_function_enabledz_false true;
transf_minR2_p25 0;
transf_offset_001 0 0 3;
transf_offset_002 0 0 1.7;
transf_offset_05 0;
transf_offset_1 2;
transf_offset_111 1 1 3;
transf_offset_2 0.9999999999999997;
transf_offsetA_0 2.7;
transf_offsetA_1 1.5;
transf_offsetA_2 1.199999999999999;
transf_offsetB_0 2;
transf_scale_2 1.2;
transf_start_iterations_A 6;
transf_start_iterations_M 4;
transf_stop_iterations_A 7;
transf_stop_iterations_C 7;
transf_stop_iterations_X 7;
[fractal_3]
transf_function_enabledAx false;
transf_function_enabledAy false;
transf_function_enabledBz_false true;
transf_function_enabledG_false true;
transf_function_enabledM false;
transf_function_enabledR_false true;
transf_function_enabledSw_false true;
transf_function_enabledX_false true;
transf_offset_0005 0.01;
transf_radius_1 0.6;
transf_rotation 0 0 30;

@buddhi1980
Copy link
Owner

I will start again an investigation with first settings which are in this issue. I need to find why it doesn't work in OpenCL mode when check for bailout condition is enabled on second formula tab. Last example is too complicated to analyze this effect.

@buddhi1980
Copy link
Owner

Hybryd Color formula fails because it is considered as a death computation (result before and after iteration is the same). Now I'm wondering why it works in CPU mode. I'm close to fix this problem.

buddhi1980 added a commit that referenced this issue Nov 24, 2019
@buddhi1980
Copy link
Owner

Check if it works now

@mclarekin
Copy link
Collaborator Author

a)  all settings files in #685 now work,  including those that did not use any T>Hybrid color2 or  T>DIFS Hybrid Color. Thanks, i would never have found that :)

b) I will think about  possible  backwards compatibility  . Materials Editor -  Pre - 2.15 orbit trap color checkbox can be moved into a Pre -2.20 Compatibility checkgroupbox 

c) I will remove code :
  void TransfHybridColor2Iteration(CVector4 &z, const sFractal *fractal, sExtendedAux &aux)
{
  z.x += 0.000000001; // so not detected as a  zero change in z

d) I still have some problems with  some options in  T>Hybrid color2 with openCL. I will relook at this, but it does not effect the release of v2.20

@mclarekin
Copy link
Collaborator Author

Everything appears to be working as expected.

TODO is general backwards compatibility issue related to bailout fix. I will look at that tomorrow

@buddhi1980
Copy link
Owner

a) Great!
b) I would not add any compatibility checkbox for this issue, because Hybrid Coloring was never completed before (in 2.19 it was still experimental). Every option in main iteration loop slows down rendering
c) yes, this code can be now removed. I I knew that there was such a code, I would find this problem much faster.
d) to be investigated

@mclarekin
Copy link
Collaborator Author

I have completed d)

The last two settings above were to demonstrate a difference when Hybrid color was not being used.
e) first, the least important,

is color by numbers -colorValue iteration components. Your fix has corrected this, top images are c++ and openCL, bottom image is now what we get in both modes Backwards compatibilty is very very minor because i assume nobody uses it.
colrValue_iteration_components

@mclarekin
Copy link
Collaborator Author

f) this is a new test for aux.color, hybrid mode - extra hybrid mode controls - only aux.color active. Latest build shows some minor differenec with openCL

  • ignore c++ difference as assume c++ is seldom used
  • in hybrid mode, we can assume that most users do not use extra hybrid mode controls, therefore their color is also contains orbitTrap color, so the difference would be less obvious in a lot of cases.
    I will do some more testing, but my current feeling is that the backwards compatibilty issue can be ignored. (it should only effect a few users, who can always use V2.19 if they want to re-render an old image)

auxColor

@mclarekin
Copy link
Collaborator Author

mclarekin commented Nov 26, 2019

g) further testing produced major difference in pseudo Kleinian openCL. The good thing is the bailout fix has removed the ugly color cuts that we use to get with pKlien. Left image is openCL before the fix. If I increase color speed on the latest build image, color stays perfect, no cuts.

# Mandelbulber settings file
# version 2.20
# only modified parameters
[main_parameters]
ambient_occlusion_enabled true;
background_3_colors_enable false;
background_color_1 0000 aa00 ff00;
camera -0.721285304338675 -4.818733761278942 0.3812866615082037;
camera_distance_to_target 1.721461653709412;
camera_rotation -0.9784713988658056 -12.36778812482929 0;
camera_top 0.003657597306812026 0.2141549727466719 0.9767928488834331;
flight_last_to_render 0;
formula_1 2104;
formula_2 103;
formula_3 2104;
fov 0.5;
fractal_enable_1 false;
fractal_enable_3 false;
glow_enabled false;
hybrid_fractal_enable true;
image_proportion 3;
image_width 900;
keyframe_last_to_render 0;
mat1_is_defined true;
N 31;
raytraced_reflections true;
target -0.69257060867735 -3.137467522557884 0.01257332301640735;
view_distance_max 1331.370849898476;
volumetric_fog_colour_1_distance 0.03125;
volumetric_fog_colour_2_distance 0.0625;
volumetric_fog_density 0.125;
volumetric_fog_distance_factor 0.0625;
[fractal_1]
boxfold_bulbpow2_z_factor 1;
fold_color_difs1 0.9;
mandelbox_color 0 1.85 0;
mandelbox_color_Sp1 0;
mandelbox_main_rotation_enabled true;
mandelbox_scale 1.2;
transf_addition_constant 0 0 0.3;
transf_addition_constant_0555 1 1 1;
transf_folding_limit 0.9;
transf_function_enabled_false true;
transf_function_enabledAz_false true;
transf_function_enabledB_false true;
transf_function_enabledBx false;
transf_function_enabledBy false;
transf_function_enabledBy_false true;
transf_function_enabledD_false true;
transf_function_enabledK_false true;
transf_function_enabledM false;
transf_function_enabledM_false true;
transf_function_enabledz_false true;
transf_minimum_radius_05 0;
transf_minR2_p25 0;
transf_offset_001 0 0 1.7;
transf_offset_002 0 0 1.7;
transf_offset_05 0;
transf_offset_1 2;
transf_offset_111 1 1 3;
transf_offset_2 1;
transf_offsetA_0 1.2;
transf_offsetA_1 1.5;
transf_offsetA_2 1.2;
transf_offsetE_2 0.7;
transf_offsetF_2 1.2;
transf_scale_2 1.2;
[fractal_2]
fold_color_difs1 0.2;
mandelbox_color 0 0 0.07000000000000001;
mandelbox_color_Sp1 0;
mandelbox_color_Sp2 0;
mandelbox_main_rotation_enabled true;
mandelbox_scale 1.1;
transf_addition_constant_0555 1 1 1;
transf_folding_limit 0.9;
transf_function_enabledAz_false true;
transf_function_enabledBx false;
transf_function_enabledBy false;
transf_function_enabledK_false true;
transf_function_enabledM false;
transf_function_enabledz_false true;
transf_minR2_p25 0;
transf_offset_001 0 0 3;
transf_offset_002 0 0 1.7;
transf_offset_05 0;
transf_offset_1 2;
transf_offset_111 1 1 3;
transf_offset_2 0.9999999999999997;
transf_offsetA_0 2.7;
transf_offsetA_1 1.5;
transf_offsetA_2 1.199999999999999;
transf_offsetB_0 2;
transf_scale_2 1.2;
transf_start_iterations_A 6;
transf_start_iterations_M 4;
transf_stop_iterations_A 7;
transf_stop_iterations_C 7;
transf_stop_iterations_X 7;
[fractal_3]
transf_function_enabledAx false;
transf_function_enabledAy false;
transf_function_enabledBz_false true;
transf_function_enabledG_false true;
transf_function_enabledM false;
transf_function_enabledR_false true;
transf_function_enabledSw_false true;
transf_function_enabledX_false true;
transf_offset_0005 0.01;
transf_radius_1 0.6;
transf_rotation 0 0 30;

pk col

@buddhi1980
Copy link
Owner

So we are not taking any further actions in this topic. Can we close this issue?

@mclarekin
Copy link
Collaborator Author

Original issue is fixed, T>hybrid color2 working as expected, (and T>DIFS hybrid color)

However my latest test for general backwards compatibility issues related to the fix in bailout code, appears to show a major difference in color with pseudoKleinian in hybrid mode.

Please check the latest settings above in openCL mode for reproducibility.

we can :
a) advise users and add no backwards compatibilty code
b) we can rename preV2.15 orbit color to pre v2.20 color and use it to access backwards compatibilty code

@mclarekin
Copy link
Collaborator Author

The issue title is now confusing. Made new issue #742
Original issue fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants