mirror of
https://github.com/stevenrobertson/cuburn.git
synced 2025-02-05 11:40:04 -05:00
now the chaos 'if chain' is only used if there are non-unity chaos entries in the genome.
This commit is contained in:
parent
50b664b1f9
commit
b732a3c244
@ -92,6 +92,7 @@ void iter(mwc_st *msts, iter_info *infos, float4 *accbuf, float *denbuf) {
|
|||||||
while (nsamps > 0) {
|
while (nsamps > 0) {
|
||||||
float xfsel = mwc_next_01(&rctx);
|
float xfsel = mwc_next_01(&rctx);
|
||||||
|
|
||||||
|
{{if packer.get("cp.chaos_used")==True}}
|
||||||
{{for density_row_idx, prior_xform_idx in enumerate(features.std_xforms)}}
|
{{for density_row_idx, prior_xform_idx in enumerate(features.std_xforms)}}
|
||||||
{{for density_col_idx, this_xform_idx in enumerate(features.std_xforms)}}
|
{{for density_col_idx, this_xform_idx in enumerate(features.std_xforms)}}
|
||||||
if (last_xf_used == {{prior_xform_idx}} &&
|
if (last_xf_used == {{prior_xform_idx}} &&
|
||||||
@ -101,6 +102,13 @@ void iter(mwc_st *msts, iter_info *infos, float4 *accbuf, float *denbuf) {
|
|||||||
} else
|
} else
|
||||||
{{endfor}}
|
{{endfor}}
|
||||||
{{endfor}}
|
{{endfor}}
|
||||||
|
{{else}}
|
||||||
|
{{for density_col_idx, this_xform_idx in enumerate(features.std_xforms)}}
|
||||||
|
if (xfsel < {{packer.get("cp.norm_density[%d]" % (density_col_idx))}}) {
|
||||||
|
apply_xf{{this_xform_idx}}(&x, &y, &color, &rctx);
|
||||||
|
} else
|
||||||
|
{{endfor}}
|
||||||
|
{{endif}}
|
||||||
{
|
{
|
||||||
//printf("%d ",last_xf_used);
|
//printf("%d ",last_xf_used);
|
||||||
denbuf[0] = xfsel;
|
denbuf[0] = xfsel;
|
||||||
|
@ -46,14 +46,19 @@ class Genome(object):
|
|||||||
# Chaos support
|
# Chaos support
|
||||||
num_std_xf = len(dens)
|
num_std_xf = len(dens)
|
||||||
self.chaos_densities = np.zeros( (num_std_xf,num_std_xf) )
|
self.chaos_densities = np.zeros( (num_std_xf,num_std_xf) )
|
||||||
|
self.chaos_used = False
|
||||||
for r in range(num_std_xf):
|
for r in range(num_std_xf):
|
||||||
chaos_row = np.array([ctypes_genome.chaos[r][c] for c in range(num_std_xf)])
|
chaos_row = np.array([ctypes_genome.chaos[r][c] for c in range(num_std_xf)])
|
||||||
|
if np.any(chaos_row != 1.0):
|
||||||
|
self.chaos_used = True
|
||||||
chaos_row = chaos_row * dens
|
chaos_row = chaos_row * dens
|
||||||
chaos_row /= np.sum(chaos_row)
|
chaos_row /= np.sum(chaos_row)
|
||||||
chaos_row = [np.sum(chaos_row[:i+1]) for i in range(len(dens))]
|
chaos_row = [np.sum(chaos_row[:i+1]) for i in range(len(dens))]
|
||||||
self.chaos_densities[r,:] = chaos_row
|
self.chaos_densities[r,:] = chaos_row
|
||||||
###############
|
###############
|
||||||
|
|
||||||
|
dens /= np.sum(dens)
|
||||||
|
self.norm_density = [np.sum(dens[:i+1]) for i in range(len(dens))]
|
||||||
self.camera_transform = self.calc_camera_transform()
|
self.camera_transform = self.calc_camera_transform()
|
||||||
|
|
||||||
scale = property(lambda cp: 2.0 ** cp.zoom)
|
scale = property(lambda cp: 2.0 ** cp.zoom)
|
||||||
|
Loading…
Reference in New Issue
Block a user