Triangulate a quad with a hole in it using tessellation (Triangulate a quad with a hole in it using tessellation)


문제 설명

Triangulate a quad with a hole in it using tessellation (Triangulate a quad with a hole in it using tessellation)

Is it possible to triangulate a quad with a hole in it using tesselation shader? For example,

  

  1. Imagine I have a Quad.
  2. Then I want to make a hole to the center of the quad.
  3. There need to be a lot more of vertices to make that hole.

And the questions:

  • Can I do that using Tessellation shader? If so, how?
  • Should I use Geometry shader instead?

참조 솔루션

방법 1:

That is not a typical application of the tessellation shader, and that's also not what is done. Basically, you have a coarse 3d model, which is passed to your graphics card. The graphics card actually implements the tessellation algorithm, which creates a more refined 3d model by tessellating the primitives. 

You have to supply two shaders: Tessellation control‑ and evaluation shaders (in OpenGL terms)

In the tessellation control shader you can "parameterize" the tessellation algorithm (inner and outer tessellation factors etc). Then the tessellation algorithm is applied. Thereafter the tessellation evaluation shader is used to, e.g. interpolate vertex attributes for the fine vertices.

What you want to do reminds me of CSG (http://en.wikipedia.org/wiki/Constructive_solid_geometry). It's true that the tessellation shader creates new data, but you may just paramterize the algorithm. You cannot "implement" the tessellation algorithm. Ad Geometry shader: it's true that you can emit (limited amount of) new primitives, but it also does not apply to your problem.

(by Jorjondinony)

참조 문서

  1. Triangulate a quad with a hole in it using tessellation (CC BY‑SA 3.0/4.0)

#graphics #tesselation #geometry-shader #opengl #shader






관련 질문

Triangulate a quad with a hole in it using tessellation (Triangulate a quad with a hole in it using tessellation)

기존 이미지가 화면에 그려지지 않는 이유는 무엇입니까? (Why won't my existing image draw to the screen?)

barplot()에서 정보를 저장하고 그래프를 표시하지 않는 방법 (How to save information from barplot() and not displaying the graph)

Java 시간에 따라 사각형을 이동하는 방법 (java how to make a rectangle move by time)

큐브맵을 2D 텍스처로 투영 (Project cubemap to 2D texture)

OpenGL & Qt : 마우스 오버 시 레이블 표시 (OpenGL & Qt : display a label on the mouseover)

프리파스칼에서 기능적 그래픽을 얻으려면 어떻게 해야 합니까? (How do I get functional graphics from freepascal?)

스크래치 및 승리 (Scratch and win)

벡터 병합 알고리즘 도움말 (Help with algorithm for merging vectors)

WPF - ScreenSaver 그래픽 성능 향상 (WPF - ScreenSaver graphics performance improvements)

Java, 패널용 그래픽 개체 생성 및 편집? (Java, create and edit a Graphics Object for Panel?)

정점 셰이더의 out 변수는 어떻게 보간됩니까? (How are the out variables of vertex shader interpolated?)







코멘트