Question: Please help with this: Requirements: Surface Effects Textures Create a texture from a file that is suitable for the ground. Use texture unit 1 Immediately

Please help with this:
Requirements: Surface Effects
Textures
Create a texture from a file that is suitable for the ground. Use texture unit 1
Immediately after creating this texture using init_texture_from_file, set the wrap method for both S and T to mirrored repeat.Use the function glTexParameteri with the binding point GL_TEXTURE_2D.You will find examples of that code in module 5.
Create three 2D textures that will be used on the columns Use texture units 2,3, and 4Create a texture from a file that is a wood texture. This will be used on the rotating blocks. Use texture unit 0
For columns
Set the diffuse color to a color with these components:
red = x * ca /(number-1)+ cbgreen = y * ca /(number-1)+ cbblue =(x + y)* ca /(2*number-2)+ cb)Use the function cs4722::Color::colorRGB to create the color. Documentation of the function is on this pageThe values of ca and cb are already computed in the code.
Set the surface effect to (2x +3y +4)%5Set the texture unit to (y %3)+2
For the rotating blocks
Set the surface effect to just use a textureSet the texture unit to 0
For the ground
Set the surface effect to just use a textureSet the texture unit to 1Set the texture_scale of the ground block to number
In the fragment shader
Comment out the code assigning s_color to fColor and add code that provides the following effects:surface effect 0: s_colorsurface effect 1: diffuse colorsurface effect 2: texture samplesurface effect 3: mix s_color and texture samplesurface effect 4: mix s_color and diffuse colorelse: (0,0,1,1)

Step by Step Solution

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 Programming Questions!