Skip to content

Debugging with dat.gui? #297

Answered by vanruesc
user28111999 asked this question in Q&A
May 17, 2021 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Ah sorry, I forgot that uniforms have a value property. The following code should work even in useEffect():

const uniforms = ssaoEffect.ssaoMaterial.uniforms;

// Aliases used for displaying purposes in the GUI.
const params = {
	"intensity": uniforms.intensity.value
};

// Using a proxy object allows us to display the label "intensity" instead of "value".
menu.add(params, "intensity", 1.0, 20.0, 0.01).onChange((value) => {

	uniforms.intensity.value = value;

});

// This would work too, but displays "value" in the GUI.
// menu.add(uniforms.intensity, "value", 1.0, 20.0, 0.01);

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@user28111999
Comment options

Comment options

You must be logged in to vote
1 reply
@user28111999
Comment options

Answer selected by user28111999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants