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?
Welcome to the community! Thank you for bringing us your question
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?
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?
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:
- opengl - What exactly is a vertex attribute? - Stack Overflow
- Vertex Specification - OpenGL Wiki
- https://www.reddit.com/r/opengl/comments/91jcnf/what_is_a_vertex_attribute_in_opengl/
-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?
@livizy I think this really just depends on your use case. Vertex attributes can contain many members including positions, normals, texture coordinates, etc.
Yes! I think the following two GitHub issues provide nice examples and applications for DebugAppearance
:
- Partial ellipsoid by srtrotter Ā· Pull Request #5995 Ā· CesiumGS/cesium Ā· GitHub
- Add ability for path color to change or fade out over time Ā· Issue #3759 Ā· CesiumGS/cesium Ā· GitHub
-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!
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