오픈지엘 질문입니다.

karin92의 이미지

glEnable(GL_POINT_SMOOTH);

이 구문 말인데요.

윈도우 glut에서 할 때, winapi에서 할 때 정상작동 했는데

우분투 Qt에서 동일한 코드로 작업했을 때는 작동하지 않습니다.

코드는 기본 예제 수준이라 올리지 않았습니다.

왜 작동 안하는지 어떻게 해결해야 하는지 아는분 계신가요?

shint의 이미지

GL_POINT_SMOOTH QT 구글 검색

//
Qt C++ Library for Windows and OpenGL, glEnable(GL_POINT_SMOOTH) not working
https://stackoverflow.com/questions/46705533/qt-c-library-for-windows-and-opengl-glenablegl-point-smooth-not-working

//
glPointSize does not work with QOpenGLWidget
https://bugreports.qt.io/browse/QTBUG-42866

The QGLWidget version works by accident since the context used by the QGLWidget happens to be current when setPointSize is called. With QOpenGLWidget there are multiple contexts in use so it happens that another one is current so the point size is changed in that one instead of the one used by the QOpenGLWidget's paintGL.
QGLWidget 버전은 setPointSize가 호출 될 때 QGLWidget에서 사용 된 컨텍스트가 최신 상태로 발생하기 때문에 우연히 작동합니다. QOpenGLWidget을 사용하면 여러 컨텍스트가 사용되므로 다른 하나가 현재 상태이므로 QOpenGLWidget의 paintGL에서 사용되는 포인트 크기 대신 해당 포인트 크기가 변경됩니다.

//
How to apply glPointSize(float) in Qt OpenGL?
https://stackoverflow.com/questions/11651732/how-to-apply-glpointsizefloat-in-qt-opengl

Presumably you are doing this in a QGlWidget not a QWidget?
Did you remember glBegin(GL_POINTS)?

Do you mean you can't see the points or the size change has no effect?
The size value is arbitrary, sometimes you have to specify a much bigger value (10 or 20) to see any change from 1.

아마도 QWidget이 아닌 QWlWidget에서 이것을 수행하고있을 것입니다.
glBegin (GL_POINTS)을 기억 했습니까?
포인트를 볼 수 없거나 사이즈 변경이 효과가 없다는 것을 의미합니까?
크기 값은 임의적입니다. 1에서 변경된 값을 보려면 더 큰 값 (10 또는 20)을 지정해야하는 경우가 있습니다.

//----------------------------------------------

GL_POINT_SMOOTH

//
Best practice for drawing many circles (i.e. GL_POINT_SMOOTH)?
https://www.reddit.com/r/webgl/comments/6jbqt0/best_practice_for_drawing_many_circles_ie_gl/

Hey guys, so I want to draw a bunch of circles of a fixed radius. This is something that I'd use GL_POINT_SMOOTH for on desktop GL, but according to some searches that's not an option with WebGL.
What's the best practice here? I could a) do uniforms and a separate draw call for each circle (ugh), or b) look into uniform buffer objects / instanced rendering, something like that. Thoughts? All advice is appreciated.

//
glEnable ? enable or disable server-side GL capabilities
https://www.khronos.org/registry/OpenGL-Refpages/es1.1/xhtml/glEnable.xml

//
glEnable(GL_POINT_SMOOTH) but the points are still square
https://www.gamedev.net/forums/topic/551434-glenablegl_point_smooth-but-the-points-are-still-square/

Unless going with a software rasterizer (in which case Mesa is an option) is out of the question, your only chance is the driver. If updating the graphics driver doesn't "fix" this, then chances are your manufacturer just doesn't focus on round points, so getting a new graphics card from another manufacturer would be the second step.
That, however, excludes all other options to get smooth dots, like manually drawing discs or textured objects instead of actual point primitives.

소프트웨어 래스터 라이저를 사용하지 않는 한 (이 경우 Mesa는 옵션입니다.) 문제가되지 않으면 드라이버가 유일한 기회입니다. 그래픽 드라이버를 업데이트해도이 문제가 "수정"되지 않으면 제조업체가 라운드 포인트에만 집중하지 않을 가능성이 있으므로 다른 제조업체의 새 그래픽 카드를 얻는 것이 두 번째 단계입니다.
그러나 실제 점 프리미티브 대신 수동으로 디스크 나 텍스처 개체를 그리는 것과 같은 부드러운 점을 얻기위한 다른 모든 옵션은 제외됩니다.

//
Thread: GL_POINT_SMOOTH (circles vs squares)
https://www.opengl.org/discussion_boards/showthread.php/140819-GL_POINT_SMOOTH-%28circles-vs-squares%29

for what i know, you ALWAYS HAVE to glEnable(GL_BLEND) to obtain antialiasing... the software renderers (SGI's for Windows, Microsoft's and Apple's) correctly implement point antialiasing.
the trouble starts when using hardware-acceleration. it seems to me that not all hw-accelerated renderers support GL_POINT_SMOOTH. in fact, the only one i found out to be correctly implementing GL_POINT_SMOOTH is ATI's RADEON VE SDR x86/SSE2 win release. of course, there may be others...
isn't it is curious that a sw-renderer does a better job than a hw-renderer?
maybe we got to use some proprietary extensions instead of GL_POINT_SMOOTH (like in example GL_VENDOR_POINT_SMOOTH that of course doesn't exist)? and if yes, which one? anyone got some useful hints?

내가 알기로, 당신은 언제나 앤티 엘리 어싱을 얻기 위해 glEnable (GL_BLEND)해야만한다 ... 소프트웨어 렌더러 (Windows, 마이크로 소프트, 애플의 SGI 's)는 point antialiasing을 올바르게 구현한다.
문제는 하드웨어 가속을 사용할 때 시작됩니다. hw 가속 렌더러 모두가 GL_POINT_SMOOTH를 지원하는 것은 아닙니다. 사실, GL_POINT_SMOOTH를 올바르게 구현하는 유일한 방법은 ATI의 RADEON VE SDR x86 / SSE2 win release입니다. 물론, 다른 사람들이 있을지도 모른다. ..
sw-renderer가 hw-renderer보다 더 좋은 일을하는지 궁금하지 않습니까?
어쩌면 GL_POINT_SMOOTH 대신 독점적 인 확장을 사용해야 할 것입니다 (예 : GL_VENDOR_POINT_SMOOTH는 물론 존재하지 않습니다). 그렇다면 어느 것이겠습니까? 누구라도 유용한 힌트를 얻었습니까?

//
Why doesn't “glEnable(GL_POINT_SMOOTH);” work to make the following point as a circle?
https://stackoverflow.com/questions/4257969/why-doesnt-glenablegl-point-smooth-work-to-make-the-following-point-as-a-c

Actually, to get smoothing to work, you probably just need to enable blending. Try adding:

glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
I know this is necessary for line smoothing, and I'm pretty sure it's the same for points.

실제로 부드럽게 작동하려면 블렌딩을 활성화해야합니다. 다음을 추가해보십시오.

glEnable (GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
라인 스무딩을 위해 이것이 필수적이라는 것을 알고 있으며, 포인트에 대해서도 동일하다고 확신합니다.

//
Drawing points with GL_POINTS and GL_POINT_SMOOTH results it two pixel tall points?
https://stackoverflow.com/questions/11837506/drawing-points-with-gl-points-and-gl-point-smooth-results-it-two-pixel-tall-poin

This code caused the error:

glHint(GL_POINT_SMOOTH, GL_NICEST);
glHint(GL_LINE_SMOOTH, GL_NICEST);
glHint(GL_POLYGON_SMOOTH, GL_NICEST);
These are not the correct flags to give to glHint.

This code fixed it and got rid of a ENUM error that OpenGL was throwing. I found that one through debugging whole other issue. Serves me right for not checking error states!

glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);

//
How to enable point smoothing
https://forum.openframeworks.cc/t/how-to-enable-point-smoothing/20688

As far as I know point smoothing is hardware dependent, your card may or may not implement round points when using GL_POINT_SMOOTH.
If the calls above don't work (and there isn't something missing that I am also missing) then your card probably doesn't do round points with point smoothing turned on and indeed it would be hard to implement what you are asking for.
I'd use point sprites with a nice round texture instead, way better. The pointsAstextures example shows you how to use it. It'll work with anything that draws points, not just a vbo like in the sample.

포인트 스무딩은 하드웨어에 따라 다르지만 GL_POINT_SMOOTH를 사용하면 카드에 라운드 포인트가 구현되거나 구현되지 않을 수 있습니다.
위의 호출이 작동하지 않는 경우 (그리고 누락 된 것이 누락 된 것이없는 경우) 카드가 포인트 스무딩을 사용하는 라운드 포인트를 수행하지 않고 실제로 요구하는 것을 구현하는 것이 어려울 것입니다 .
대신 좋은 둥근 텍스처로 점 스프라이트를 사용하는 것이 좋습니다. pointsAstextures 예제에서는이를 사용하는 방법을 보여줍니다. 샘플 에서처럼 vbo가 아니라 포인트를 그리는 모든 것을 사용할 수 있습니다.

Fullscreen AntiAliasing
http://nehe.gamedev.net/tutorial/fullscreen_antialiasing/16008/

OpenGL Antialiasing
https://forum.libcinder.org/topic/opengl-antialiasing

Основы программирования OpenGL в Borland С++Builder и Delphi. (Часть 2) (2 стр.)
http://www.gamedev.ru/code/articles/OpenGL_Delphi_2?page=2

OpenGL Conformance - Open Scene Graph 3D 예제 데모
http://trac.openscenegraph.org/projects/osg/wiki/Community/Tasks/OpenGLConformance

//
Opengl: Transparency and Depth Test Problems
https://stackoverflow.com/questions/9267414/opengl-transparency-and-depth-test-problems

The drawing order is the cause.

Depth sorted drawing of faces is required (from far to near). If intersection occurs, depth sorting must be applied for each sub face defined by intersection. For your specific case, splitting the cube's geometry by the plane in two halves and then draw the faces in order will theoretically do the job.

EDIT: If the cube is the only transparent object, depth sorted drawing of the cube (without splitting up the geometry) after rendering the plane works aswell.
Another solution is fragment based depth sorting using shader techniques like depth peeling.
2) As mentioned, backfaces of a semitransparent object must be drawn with face culling off.
그리기 순서가 원인입니다.

면을 깊이 정렬하여 그리는 작업이 필요합니다 (먼 곳에서 가까운 곳까지). 교차가 발생하면 교차로 정의 된 각 부면에 깊이 정렬을 적용해야합니다. 특정 경우에 대해, 비행기로 큐브의 지오메트리를 두 개의 반으로 나눈 다음, 순서대로면을 그립니다. 이론적으로는 작업을 수행합니다.

편집 : 큐브가 유일한 투명한 개체 인 경우 평면 렌더링 후 큐브의 깊이 정렬 정렬 (형상 분할없이)도 작동합니다.
또 다른 솔루션은 깊이 필링 (depth peeling)과 같은 셰이더 기술을 사용하는 단편 기반 깊이 정렬입니다.
2) 앞서 언급했듯이, 반투명 오브젝트의 뒷면은면 제거 (face culling)로 그려야합니다.

//
Qt C++ Library for Windows and OpenGL, glEnable(GL_POINT_SMOOTH) not working
https://stackoverflow.com/questions/46705533/qt-c-library-for-windows-and-opengl-glenablegl-point-smooth-not-working

//
Wrong alpha blending when rendering on a QGLFramebufferObject
https://stackoverflow.com/questions/12306894/wrong-alpha-blending-when-rendering-on-a-qglframebufferobject

Try the following:

QGLFramebufferObjectFormat fmt;
fmt.setSamples(1); // or 4 or disable this line
fmt.setInternalTextureFormat(GL_RGBA8);
QGLFramebufferObject fbo(width(), height(), fmt);
This forces a specific pixel format and also disables rendering to a texture by using multisampling (otherwise QT always renders to a texture). That might produce different results. You can also experiment with the format.

Also, what is your hardware? My maximal point size is only 64 pixels (GTX 260), you are trying to render 100 pixel points. That might be an issue. Are any OpenGL errors generated? Does the same happen on small points?

You might also try hinting (if it's possible in QT):

glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
But i wouldn't expect this to change anything.

다음을 시도하십시오.

QGLFramebufferObjectFormat fmt;
fmt.setSamples (1); // 또는 4 또는이 줄을 해제하십시오.
fmt.setInternalTextureFormat (GL_RGBA8);
QGLFramebufferObject fbo (width (), height (), fmt);
이렇게하면 특정 픽셀 형식이 강제로 표시되며 멀티 샘플링을 사용하여 텍스처에 렌더링 할 수 없게됩니다. 그렇지 않으면 QT가 항상 텍스처로 렌더링됩니다. 그 결과가 달라질 수 있습니다. 형식을 시험해 볼 수도 있습니다.

또한 하드웨어는 무엇입니까? 최대 포인트 크기는 64 픽셀 (GTX 260) 밖에 없으므로 100 픽셀 포인트를 렌더링하려고합니다. 그것은 문제 일 수 있습니다. OpenGL 오류가 생성 되었습니까? 같은 일이 작은 지점에서 발생합니까?

힌트를 얻을 수도 있습니다 (QT에서 가능할 경우).

glHint (GL_POINT_SMOOTH_HINT, GL_NICEST);
그러나 나는 이것이 어떤 것을 바꿀 것으로 기대하지 않을 것입니다.

//
Thread: [QtOpenGL] gl_blend vs MultiSampled
http://www.qtcentre.org/threads/52600-QtOpenGL-gl_blend-vs-MultiSampled

//
GL_POINT_SMOOTH_HINT QT

【Qt OpenGL?程】19:粒子系?
http://blog.csdn.net/cly116/article/details/47320573

The Bankslab Stimulus AntiAliasing Guide for OpenGL
http://bankslab.berkeley.edu/members/chris/AntiAliasing/AntiAliasingInOpenGL.html

----------------------------------------------------------------------------
젊음'은 모든것을 가능하게 만든다.

매일 1억명이 사용하는 프로그램을 함께 만들어보고 싶습니다.
정규 근로 시간을 지키는. 야근 없는 회사와 거래합니다.

각 분야별. 좋은 책'이나 사이트' 블로그' 링크 소개 받습니다. shintx@naver.com

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.