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?

@sam.rothstein Have I must @ can notice?

@livizy I think this really just depends on your use case. Vertex attributes can contain many members including positions, normals, texture coordinates, etc.

@sam.rothstein May I get a sample?

Yes! I think the following two GitHub issues provide nice examples and applications for DebugAppearance:

-Sam

@sam.rothstein thank you sam,I realy learn this link:

,where is the attribute ā€œstā€ come from? And is there any else attribute, where can I find them all?

Hi @livizy,

I am happy to hear that the resources that I provided were helpful! :grinning:

Quite frankly, I am not sure exactly where the st attribute comes from. In addition, I am not sure if there is a simple way to access all available attributes. Any suggestions from the rest of the community? I can check in with the rest of our CesiumJS development team if necessary.

-Sam

@sam.rothstein Thank you so much. I think hpinkos may come to rescue. Is she in your team?

1 Like