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

Unable to set COLORFUL to false #13

Closed
shaun-visser opened this issue May 8, 2024 · 5 comments
Closed

Unable to set COLORFUL to false #13

shaun-visser opened this issue May 8, 2024 · 5 comments

Comments

@shaun-visser
Copy link

setting COLORFUL false seems to stop everything from being rendered out
e.g.
useEffect(() => {
webGLFluidEnhanced.simulation(canvasRef.current!, {
SIM_RESOLUTION: 128, // Resolution of the simulation grid
DYE_RESOLUTION: 1024, // Resolution of the dye grid
CAPTURE_RESOLUTION: 512, // Resolution of captured frames
DENSITY_DISSIPATION: 1, // Rate at which density dissipates
VELOCITY_DISSIPATION: 0.2, // Rate at which velocity dissipates
PRESSURE: 0.8, // Pressure value used in the simulation
PRESSURE_ITERATIONS: 20, // Number of pressure iterations
CURL: 10, // Curl value used in the simulation
INITIAL: false, // Enables splats on initial load
SPLAT_AMOUNT: 5, // Number of initial splats (Random number between n and n * 5)
SPLAT_RADIUS: 0.25, // Radius of the splats
SPLAT_FORCE: 6000, // Force applied by the splats
SPLAT_KEY: '', // Keyboard key to spawn new splats (empty to disable)
SHADING: false, // Enables shading in the visualization
COLORFUL: false, // Enables rapid changing of colors
COLOR_UPDATE_SPEED: 10, // Speed of color update
COLOR_PALETTE: ['#ffff00', '#ffff00', '#ffff00', '#ffff00', '#ffff00'], // Custom color palette (empty by default, uses hex colors)
HOVER: true, // Enables interaction on hover
BACK_COLOR: '#ffffff', // Background color of the canvas
TRANSPARENT: false, // Makes the canvas transparent if true
BRIGHTNESS: 1, // Color brightness (Recommend lower than 1.0 if BLOOM is true)
BLOOM: false, // Enables bloom effect
BLOOM_ITERATIONS: 8, // Number of bloom effect iterations
BLOOM_RESOLUTION: 256, // Resolution of the bloom effect
BLOOM_INTENSITY: 0.8, // Intensity of the bloom effect
BLOOM_THRESHOLD: 0.6, // Threshold for the bloom effect
BLOOM_SOFT_KNEE: 0.7, // Soft knee value for the bloom effect
SUNRAYS: false, // Enables sunrays effect
SUNRAYS_RESOLUTION: 196, // Resolution of the sunrays effect
SUNRAYS_WEIGHT: 1.0, // Weight of the sunrays effect
});
}, []);

@michaelbrusegard
Copy link
Owner

michaelbrusegard commented Jun 28, 2024

You are right, it seems to be broken. I will try to implement a fix when I can

@michaelbrusegard
Copy link
Owner

@shaun-visser So I did some experimenting and figured out that disabling colorful only works when you disable hover. This is because the color is supposed to only change when you reclick the canvas when you are not hovering, I can probably fix this but I am unsure on how the implementation would be best when you have hover enabled

@michaelbrusegard
Copy link
Owner

I have a large upcoming rewrite of the package that solves this

@bfelbo
Copy link

bfelbo commented Sep 8, 2024

Awesome that you're looking into this! I need to use the library w/o colorful: true so this is currently a blocker.

Great tweaks btw with the TS support and detailed README 💯

@michaelbrusegard
Copy link
Owner

@bfelbo and @shaun-visser seems to fix this now

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

No branches or pull requests

3 participants