Modify the fragment shader in Program 15.8 so that the water caustics are also rendered when the
Question:
Modify the fragment shader in Program 15.8 so that the water caustics are also rendered when the camera is above the top surface as well. Do you think that the scene appears more realistic or less realistic with the caustics included in this case? If the latter, try to find a way to tune the caustics so that they increase realism rather than detracting from it.
Program 15.8
Transcribed Image Text:
Fragment Shader (for floor) float getCausticValue(float x, float y, float z) { float w = 8; float strength = 4.0; float PI 3.14159; // frequency of caustic curved bands float noise = texture(noise Tex, vec3(x*w, y, z*w)).r; return pow((1.0-abs(sin(noise*2*P))), strength); } void main(void) { ... color = vec4((mixColor * (ambient + diffuse) + specular), 1.0); // add caustics if (isAbove != 1) {float causticColor = getCausticValue(tc.s, depth Offset, tc.t); float colorR = clamp(color.x + causticColor, 0.0, 1.0); float colorG = clamp (color.y + causticColor, 0.0, 1.0);
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 0% (1 review)
Answered By
Utsab mitra
I have the expertise to deliver these subjects to college and higher-level students. The services would involve only solving assignments, homework help, and others.
I have experience in delivering these subjects for the last 6 years on a freelancing basis in different companies around the globe. I am CMA certified and CGMA UK. I have professional experience of 18 years in the industry involved in the manufacturing company and IT implementation experience of over 12 years.
I have delivered this help to students effortlessly, which is essential to give the students a good grade in their studies.
3.50+
2+ Reviews
10+ Question Solved
Related Book For
Computer Graphics Programming In OpenGL With JAVA
ISBN: 9781683922193
2nd Edition
Authors: V. Scott Gordon PhD, John L. Clevenger PhD
Question Posted:
Students also viewed these Computer science questions
-
In 1988, Peter Gabriel, a well-known musician, joined Amnesty International on its Human Rights Now tour. Over a six week period, Gabriel and some other popular music artists performed at twenty...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Find the equations of the parabolas satisfying the given conditions. The vertex of each is at the origin. Directrix y = 0.16
-
Consider an LTI system with frequency response, The input x[n] to the system is restricted to be real valued and to have a Fourier transform (i.e., x[n] is absolutely summable). Determine whether or...
-
Delaware Chemical Company uses oil to produce two types of plastic products, P1 and P2. Delaware budgeted 35,000 barrels of oil for purchase in June for $ 90 per barrel. Direct labor budgeted in the...
-
Use the implicit finite difference method to solve the heat conduction problem on the unit square: \[\begin{aligned}& \frac{\partial^{2} u}{\partial x^{2}}=\frac{\partial u}{\partial t} \\& u(x, 0)=x...
-
Collins Corporation purchased office equipment at the beginning of 2009 and capitalized a cost of $2,000,000. This cost figure included the following expenditures: The company estimated an eight-year...
-
At December 31, 2022, Palestine Commercial Bank reports the following balance sheet information: Current assets $800,000 Noncurrent assets 2,600,000 Goodwill 300,000 Current liabilities (700,000)...
-
In Program 16.4, shadows can be very easily disabled by commenting out one particular line of code. Identify that line of code. Program 16.4 Compute Shader vec3 ads_phong_lighting (Ray r, Collision...
-
In Exercise 15.2 (above), if you havent done so already, add water caustics to the underwater object. Exercise 15.2 Add an object moving underwater, such as a fish or submarine (or even the Studio...
-
In hen egg white lysozyme (Section 11-4), the substitution of Ala for Asn at position 37 or for Trp at position 62 may alter the enzyme's kinetics. What changes would you predict and why?
-
Convert the context-free grammar G in Chomsky Normal Form, where G = (V,T, S,T) with V = {S, A, B, C, D), T = {a,b,c} and P: S AABD|aBB A a| B BB|bc|X CCD|a D Db DD
-
Consider the following cash flows and interest rates: 0 r = 2.5% 1 r = 1.5% 5,000 2 r = 1.9% 5,000 3 r = 2.4% 5,000 4 5,000 a. Calculate the present value of these cash flows (at time 0). (5 marks)...
-
How can legislation and regulation impact on OD and change?
-
The purpose of this assignment is to write a program that uses loops, file I/O, and methods to process employee salary data and generate a small report. Additionally, you will gain further practice...
-
List some of the indications or clues that may arise due to conflict in the workplace? and why
-
Mexico Timeshare, Inc., has the following transactions related to notes receivable during the last two months of 2008: Nov. 1 ....Loaned $18,000 cash to Norma Hanson on a one-year, 10 percent note....
-
Perform the operation by first converting the numerator and denominator to scientific notation. Write the answer in scientific notation. 7,200,00/0.000009
-
White Corporation, a calendar year C corporation, manufactures plumbing fixtures. For the current year, White has taxable income [before the domestic production activities deduction (DPAD)] of...
-
During the current year, Swallow Corporation, a calendar year C corporation, has the following transactions: Income from operations $660,000 Expenses from operations 720,000 Dividends received from...
-
Red Corporation and White Corporation, both calendar year C corporations, are members of a controlled group of corporations. For the current year, Red has taxable income of $130,000, and White has...
-
Your line manager has asked you to prepare for your annual appraisal meeting. Identify TWO areas for professional development and examine the range of self-development techniques that can be used to...
-
In this week, you have to focus on the project scheduling and budgeting aspects of the selected project on developing a corporate website. Based on your understanding of project scheduling and...
-
Choose any process of improvement in a warehouse. Give a very brief description of the process. State the business objectives that the process supports. Set the objectives and rationale for the...
Study smarter with the SolutionInn App