Figure 2. The silhouette drawing process of a ball. final rendering result from a normal view angle, we can see that the silhouettes have been drawn. So far, we know that silhouette is actually the back faces of the model that are not covered by the front faces. This method can easily draw silhouette outlines with uniform thickness. When we write a shader programm on GPU, we can implement this effect using only two passes. B. Thickness Control of Silhouette Outlines The thickness of the silhouette outlines drawn by triangle shell technique is controllable. Since silhouettes are drawn by shifting each vertex along its normals, if we shift each vertex using different offsets, lines with variant thickness will be drawn. Therefore, to determine the offset for each vertex automatically, is our key issue. According to Goodwin's theory, the aesthetically pleasing lines seem to have a general rule that the thickness is approximately equal to isophote distance, as described in formula (1). But in practice, the line thickness is changeful, that rule is not an absolute truth. So, we proposed an approximate approach, which can give a aesthetically pleasing silhouettes rendering result, and meanwhile can be implemented in real-time. The rule put forward by Goodwin can be described intuitively as the following 4 aspects: • The farther the model is from the camera, the thinner the lines are. • Lines should be thin at detail regions, thick at relatively flat regions. • Lines should be thin at bright regions, thick at dark regions. • The thickness of lines should be clamped to a certain range. First, the farther the model is from the camera, the thinner the lines are. We make the line thickness inverse proportional to depth. In triangle shell technique, if the vertex offset is fixedly proportional to the model size, the line thickness will meet this rule naturally. Here, we shift
each vertex with a constant offset Cz in the model's local coordinate system. Second, lines should be thin at detail regions, thick at relatively flat regions. Goodwin makes the line thickness inverse proportional to radial curvature to reflect this rule. However, radial curvature is view-dependent, it has to be recalculated for every new frame, and this process is hard to be accelerated by GPU. This directly affect the execution speed of the algorithm. In this paper, the mean curvature H(p)=(k1(p)+ k2(p))/2 is used instead of radial curvature. k1 (p) and k2(p) are the two principal curvatures at vertex p. The curvature calculation algorithm proposed by [15] is used. Mean curvature can also reflect the size relationship of different parts of the model, and is view-independent. So it can be precalculated and stored into a texture. Before storing it, the value should be mapped to the range [0,1]. Now, we got a map whose bright regions correspond to the convex regions of the model, and dark regions correspond to the concave regions. Now we can use mean curvature as a primary component to control the vertex offset: Ck(p)= 0.5 |H(p) 0.5| (2) Then, silhouette outline thickness is also affected by lighting conditions. In line drawings, the silhouette outline is the simplification of tone and shading, that means, artists take lines as tones to depict shape in line drawings. Therefore, the silhouette outlines should be thin at bright regions, thick at dark regions. Here we can make the thickness of the silhouette outlines inverse proportional to surface brightness. The brightness should be calculated for every vertex based on lighting model, and then we consider the brightness of the vertices as another component to control the vertex offset: Cdp = A t [lp ·np] (3) Where l
, n(p), respectively corresponding to the unit light direction vector and unit vertex normal at vertex p. A and t are user defined constants, used for adjusting the influence degree of lighting. Finaly, the range of line thickness is given by the user. We use it to clamp the vertex offset to a certain range. Considering the situaltions discussed above, we get a formula to determine the offsets for every vertex: offset(
)= T · Cz· Ck(p) · Cd(p) (4) Finaly we clamp the offset to a certain range [Tmin, Tmax], which T is a user defined constant to control the global thickness of silhouettes, Tmax and Tmin is the upper limit and lower limit of the offset respectively. We shift every vertex using the offset calculated by formula (4) in a vertex shader, and shade the back-facing surfaces in black, and we will get the silhouette rendering result which has the aesthetically pleasing appearance.
TABLE I. THE EXPERIMENTAL ENVIRONMENT IN THIS PAPER OS Windows 7 Ultimate CPU Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz GPU NVIDIA GeForce GTX 750 Ti Memory 8.00GB
รูปที่ 2 เงาการวาดกระบวนการของลูก ผลสุดท้ายผลจากมุมมองปกติ เราจะเห็นว่า เงาที่ได้ออก เพื่อห่างไกล เรารู้ว่าเงาเป็นจริงหลังใบหน้าของแบบที่จะไม่ครอบคลุมใบหน้า วิธีการนี้ได้อย่างง่ายดายสามารถวาดเค้าร่างเงาหนาเท่า ๆ กัน เมื่อเราเขียนเป็น programm shader บน GPU เราสามารถใช้ผลนี้ใช้เพียงสองผ่าน B. ควบคุมความหนาของเงาแสดงความหนาของเงา เค้าวาด โดยเทคนิคสามเหลี่ยมเปลือกจะสามารถควบคุม ตั้งแต่เงาจะวาดโดยแต่ละจุดยอดตามสถิติของ ถ้าเราเลื่อนจุดยอดแต่ละใช้ offsets ที่แตกต่างกัน จะวาดเส้นหนาแปร ดังนั้น การตรวจสอบบัญชีตรงข้ามสำหรับแต่ละจุดยอดโดยอัตโนมัติ เป็นปัญหาที่สำคัญของเรา ตามทฤษฎีของวิน บรรทัดสวยงามดูเหมือนจะ มีกฎทั่วไปว่า ความหนาจะประมาณเท่ากับระยะ isophote ตามที่อธิบายไว้ในสูตร (1) แต่ในทางปฏิบัติ ความหนาของเส้นจะ changeful กฎนั้นไม่เป็นความจริงที่สมบูรณ์ ดังนั้น เรานำเสนอวิธีการโดยประมาณ ซึ่งสามารถให้เงาสวยงามการแสดงผล และในขณะเดียวกัน สามารถนำมาใช้ในแบบเรียลไทม์ กฎโดยวินสามารถอธิบายได้เป็น 4 ด้านดังต่อไปนี้: •การไกลแบบคือจากกล้อง ทินเนอร์ที่บรรทัด •บรรทัดควรบางที่ภูมิภาครายละเอียด หนาในภูมิภาคค่อนข้างแบน •บรรทัดควรบางที่สว่างภูมิภาค หนาที่มืด •ความหนาของบรรทัดควรบีบเป็นบางช่วง ครั้งแรก ไกลออกไปแบบได้จากกล้อง ทินเนอร์ที่บรรทัดจะ เราทำให้สายหนาผกผันสัดส่วนกับความลึก ในสามเหลี่ยมเปลือกเทคนิค ออฟเซตจุดยอดเป็น fixedly สัดส่วนกับขนาดรูปแบบ ความหนาของเส้นจะตรงกับกฎนี้ตามธรรมชาติกัน ที่นี่ เราเปลี่ยน แต่ละจุดยอด ด้วยค่าคงที่ออฟเซ็ต Cz ในระบบพิกัดแบบท้องถิ่น ที่สอง บรรทัดควรบางที่ภูมิภาครายละเอียด หนาในภูมิภาคค่อนข้างแบน วินทำให้สายหนาผกผันสัดส่วนกับรัศมีความโค้งเพื่อให้สะท้อนถึงกฎนี้ อย่างไรก็ตาม รัศมีความโค้งจะขึ้นอยู่กับมุมมอง จะถูกคำนวณใหม่สำหรับทุก ๆ เฟรมใหม่ และกระบวนการนี้จะยากต่อการเร่ง โดย GPU นี้โดยตรงมีผลต่อความเร็วในการดำเนินการของอัลกอริทึม ในกระดาษนี้ โค้งเฉลี่ย H(p) = (k1(p) + k2(p)) / 2 ถูกใช้แทนรัศมีความโค้ง k1 (p) และ k2(p) จะได้หลักสองที่จุดยอด p ใช้อัลกอริทึมการคำนวณโค้งเสนอ โดย [15] หมายความว่า ความโค้งยังสามารถสะท้อนความสัมพันธ์ขนาดของส่วนต่าง ๆ ของรูปแบบ และเป็นมุมมองอิสระ ดังนั้น สามารถคำนวณล่วงหน้า และเก็บลงในเนื้อเป็น ก่อนนำไปเก็บ ค่าควรถูกแมปไปยังช่วง [0, 1] ตอนนี้ เราได้แผนที่ภูมิภาคสดใสสอดคล้องกับภูมิภาคนูนของรูปแบบ และมืดตรงกับภูมิภาคเว้า ตอนนี้เราสามารถใช้ความโค้งหมายถึงเป็นส่วนประกอบหลักในการควบคุมมอเตอร์ไฟฟ้าออฟเซต: Ck(p) = 0.5 กรุนด์ฟอส H(p) 0.5 กรุนด์ฟอส (2) แล้ว เงาเค้าร่างหนาเป็นยังผลกระทบจากสภาพแสง ในภาพวาดเส้น เค้าร่างเงาเข้าใจง่ายของโทนสีและการแรเงา หมายความ ว่า ศิลปินใช้บรรทัดเป็นโทนสีการวาดรูปร่างในภาพวาดเส้น ดังนั้น เค้าร่างเงาควรบางที่สว่างภูมิภาค หนาที่มืด ที่นี่เราสามารถทำให้ความหนาของเงาเค้าผกผันสัดส่วนกับความสว่างของพื้นผิว ควรคำนวณความสว่างสำหรับทุก ๆ จุดยอดแบบจำลองแสง แล้ว เราพิจารณาความสว่างของจุดเป็นส่วนประกอบอื่นในการควบคุมมอเตอร์ไฟฟ้าออฟเซต: Cd p = t [l p · n p] (3) สถาน l, n(p), respectively corresponding to the unit light direction vector and unit vertex normal at vertex p. A and t are user defined constants, used for adjusting the influence degree of lighting. Finaly, the range of line thickness is given by the user. We use it to clamp the vertex offset to a certain range. Considering the situaltions discussed above, we get a formula to determine the offsets for every vertex: offset()= T · Cz· Ck(p) · Cd(p) (4) Finaly we clamp the offset to a certain range [Tmin, Tmax], which T is a user defined constant to control the global thickness of silhouettes, Tmax and Tmin is the upper limit and lower limit of the offset respectively. We shift every vertex using the offset calculated by formula (4) in a vertex shader, and shade the back-facing surfaces in black, and we will get the silhouette rendering result which has the aesthetically pleasing appearance. TABLE I. THE EXPERIMENTAL ENVIRONMENT IN THIS PAPER OS Windows 7 Ultimate CPU Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz GPU NVIDIA GeForce GTX 750 Ti Memory 8.00GB
การแปล กรุณารอสักครู่..
