How can i get Cesium.DebugAppearance work?

When I learn Appearance system, I found Cesium.DebugAppearance,and I guess
this should be usefull for shader debug,but I cannot get Cesium.DebugAppearance work,Is there some tutourial about this?

@livizy

Welcome to the community! Thank you for bringing us your question :grinning: :rocket:

I do not think that we currently have a tutorial for how to use Cesium.DebugAppearance. As you can see, our documentation for Cesium.DebugAppearance does include some sample code.

var primitive = new Cesium.Primitive({
  geometryInstances : // ...
  appearance : new Cesium.DebugAppearance({
    attributeName : 'normal'
  })
});

I recommend using this code as a reference for your implementation. Let me know if you have any other questions or concerns!

-Sam

Thank you for your answer.Yes,I do read this doc,but the “attributeName : ‘normal’” confuse me.I cannot recognize what attributeName meaning and use for what. so as ‘normal’, why should use this value and is there other options?

@livizy

To the best of my knowledge, attributeName is simply the name of the attribute that is being visualized. Thus, you could name it normal, or whatever is most appropriate for your use case. What functionality are you looking for with the DebugAppearance object?

-Sam

attributeName is simply the name of the attribute from what object?
I can not found a way to debug webgl code,so I think DebugAppearance may bring some help. Am I right?

@livizy

Whether or not DebugAppearance is the correct object to use depends on what you are trying to debug. What WebGL issues are you trying to investigate? attributeName refers to the vertex attribute. For more context, I recommend reading through the following resources:

-Sam

First of all, I really appreciate your answer
In my head,DebugAppearance should show that “attribute” value in some way, but in cesium context , how can I figure out what attribute can be use, and the attribute should obey what rule?