Question: Modify Program 13.4 to additionally render the original torus. That is, render both a lighted torus and the outgoing line segments (using a geometry shader)

Modify Program 13.4 to additionally render the original torus. That is, render both a lighted torus and the outgoing line segments (using a geometry shader) so that the “hair” looks like it is coming out of the torus.

Program 13.4 layout (line_strip, max_vertices=2) out; void main(void) {vec3 op0 = gl_in[0].gl_Position.xyz; // originalvec3 op1 = gl_in[1].gl_Position.xyz; vec3 op2 = gl_in[2].gl_Position.xyz; vec3 ep0 = gl_in[0].gl_Position.xyz

layout (line_strip, max_vertices=2) out; void main(void) {vec3 op0 = gl_in[0].gl_Position.xyz; // original triangle vertices

Step by Step Solution

3.42 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Graphics Programming Questions!