-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
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
WebGLRenderer: Introduce WebGLInfo #13404
Conversation
Actually, the reason for removing vertices is the data-structure of the geometry is irrelevant. What is relevant is the number of primitives rendered. |
Also, the nomenclature |
Yes, absolutely right 😅. But after all we avoid a source of confusion by removing |
break; | ||
|
||
default: | ||
console.error( 'THREE.WebGLInfo: Unknown draw mode:', mode ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm right, this console error message shows up each render call if user sets a wrong mode. That means the tons of the same error message will be displayed on user's console until user corrects the mode.
Any solutions to avoid that? Just ignoring wrong mode would be one of the options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, we've ignored it before so we can of course remove the default
block. On the other hand, rendering with a invalid primitive is something that should actually never happen. I think it wouldn't be too bad if we produce error messages in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right. I've read through WebGLRenderer
and it seems that a wrong mode won't be set even user sets a wrong drawMode
to Mesh
. So I think it's ok to leave this console.error now.
@takahirox I've just ported your enhancement for |
This PR also "solves" the following issue: #11966 |
Any chance you could elaborate a bit? My understanding of this is that your statement is wrong, but it is complicated and I’m not sure I understand it right. |
@pailhead The proposal is to tally only triangles when rendering Meshes, tally only line segments when rendering Lines, and tally points when rendering Points. If you think doing so is incorrect or misleading, you can propose an alternate PR if you want. |
I am trying to learn the reasoning behind something like this, and to better understand how the underlying mechanics work (WebGL, GPUs). I did open an alternate PR that just got closed in favor of this, so I don't find your suggestion constructive at all :( Where should I ask my question? Your answer reads as "not here", "i don't have time to explain myself" etc. I had one (limited) understanding of how webgl and gpus work. I looked at the info numbers pre this PR and got confused. I asked first on Slack, then on Discourse, then here in the mentioned issue, then once again in my:
followed by the stack overflow question, and finally here in this PR. From the viewpoint of my question this PR is alternate, not the other one. The other PR wasn't even meant to be accepted but start this conversation, and hopefully answer some questions. Questions like:
Why is it irrelevant, why is the other relevant? It was important enough for you to outline this here, but asking to go further and elaborate is a dead end. My understanding of the SO answer is that it is not irrelevant, that cache plays a great role here, and that there's been research done on how to best use this cache. For example and convenience this: Because these were linked, and because they seem to contradict your comment I think they make the reasoning behind this PR more confusing. Without links to SO, the papers, and your comment one may think.
With the links
With your comment
Everything combined:
|
tl:dr;
I don't want to do a bunch of code for someone to come and say "Its irrelevant". The only misleading thing here I think was your comment and no explanation. Where is the proper place to address it? Writing a bunch of code just to reference some papers seems unproductive. I guess i could have quoted you, bolded the irrelevant part and just said |
@pailhead I think i understand your motivation behind your posts but i don't think that PR's should contain a tutorial for the interested reader. If users want to learn fundamental concepts of WebGL, they should study the relevant literature, documentation, specs and papers about computer graphics in general, and WebGL in particular. Reading issues and PRs is a useful addition but it can't replace the mentioned stuff. |
@pailhead I did not close your PR. I also do not know the answers to many of your questions. When I do, I do my best to answer them. Intonation does not translate well in text. My intention is to be polite. Please give me the benefit of the doubt. |
Yep, i was it 😇 . Because i think this one does exactly the same: Removing |
Thank you for reiterating the tone :) @Mugen87 Since the renderer is the only thing that instantiates geometries, maybe it would be useful to do a one time count of how many vertices are in memory or something. Not relevant to the render calls that the renderer does (drawing) but relevant to what it does automagically by creating the geometries on the gpu. Anyhow, this probably makes the level of breadcrumbs i can live with :) And thanks for trying to understand where i come from, i think i'm trying to improve a process, or at least understand it better.
Just to clarify, i wasn't referring to the other PR but a fictional PR which would be made just to ask a question. I was trying to address the way of asking a question, apologies for the confusion :) |
Very nice! 😊 |
Thanks! |
As suggested in #13316 (comment), I now definitely think And you could replace the word
|
This PR does two things:
vertices
frominfo.render
since it does not work correctly with indexed geometries, see Remove vertices render info #13316. Insteadinfo.render
now contains the rendered primitives (faces
,points
andsegments
).WebGLRenderer
by creatingWebGLInfo
.