GithubHelp home page GithubHelp logo

alecjacobson / computer-graphics-shader-pipeline Goto Github PK

View Code? Open in Web Editor NEW
14.0 7.0 22.0 8.21 MB

Computer Graphics Assignment about the Shader Pipeline

CSS 1.99% CMake 0.20% C 22.64% C++ 73.77% GLSL 1.40%

computer-graphics-shader-pipeline's People

Contributors

abhimadan avatar alecjacobson avatar ian729 avatar rarora7777 avatar texify[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

computer-graphics-shader-pipeline's Issues

Difficulty with creating smooth surface for blinn-phong shading

img1
img2
When I am testing with test-05.json, I kept getting this kind of effect instead of having a smooth rendered surface in the provided gif. I have no idea how can I fix this, can anyone help me with this?

In case to prove that I calculate the normal of surface correctly, here is the normal image of the model:
img3
And this is the normal image of the model when I adjust the tessellation level to 1:
img4

shader 'pos_fs_in' not read by fragment shader

When I tried running ./shaderpipeline ../data/test-03.json, I received the following warning:

'''
WARNING: Output of tessellation evaluation shader 'pos_fs_in' not read by fragment shader

shader compilation successful.
'''

As a result, I was unable to see through the object. Any ideas why?
Btw, running on mac 10.13.6.

screen shot 2018-11-10 at 3 17 39 am

Normal from bump.fs

To get the normal do we use the point on the sphere or the point to which the view and model matrices have been applied?
and if it the former, does that mean we would need to transform these perceived normals we obtain?

MarkUs Submission procedural_color

I know the file type doesn't matter but just for consistency, the file type of procedural_color here on github is .fs but the required file type on MarkUs is .glsl

Smooth Heavside

What's the range of this function? -1 - 1? Are we supposed to use the output of the perlin_noise as the input of this function?

Could not initialize glfw

When I tried running ./shaderpipeline ../data/test-01.json on CDF machines I got.

No protocol specified
Could not initializing glfw

Any thoughts?

planet.fs

Does it have to be earth? Can I make it into another planet?

procedural_color.glsl

after I add perlin noise offset, I get something like
screen shot 2018-11-09 at 11 31 41 pm

I can see a line through the sphere. Is it normal to see a line like this?

Another Typo

I think the professor meant perlin_noise.glsl instead rather than just noise.glsl in the README.

Also, to implement perlin_noise.glsl, you need to implement smooth_step.glsl which was not indicated in the README and people might be confused.

tangent function output

The output expected from the tangent function is

T  3D unit tangent vector
B  3D unit tangent vector

is B actually the bi-tangent vector?

Thanks

GLSL Version on UG Machines

Good afternoon,

I usually work on the UG machines in GB remotely and this has worked for all previous labs. But for this lab, in trying to check if the workspace is okay, I get:

OpenGL version recieved: 3.3.0
Supported OpenGL is 3.3 (Core Profile) Mesa 13.0.6
Supported GLSL is 3.30
../data/test-01.json has changed since last compilation attempt.

../src/version410.glsl has changed since last compilation attempt.

ERROR: failed to compile vertex shader
0:1(10): error: GLSL 4.10 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.50, 3.30, 1.00 ES, and 3.00 ES

I cannot find a way to remote into ECF machines. I tried remoting a CS machine via NoMachine but I had not luck there either. Trying to set up a work space on my personal desktop now will take a very long time. Is there a suggested workaround for this? Can I lower the version in the 410version.gl file?

Thanks,

  • A.T.

Smooth Normal transition

This relates to the snap_to_sphere implementation,
When I debug by mapping the color based on the normal value, I get a very faceted appearance and I am not sure how to get the normals of neighboring triangles so I can have a smoother transition.
does pos_es_in contain all of the neighboring triangles' vertices?

thanks

Different color when running test-01

screen shot 2018-11-08 at 8 41 35 pm

Hi everyone,
When I am testing with test-01.json, instead of the image shown in README, I get this image. Could this mean that my OpenGL setup isn't correct?

Has anyone come with this?

error when running the executable in cdf

I was able to build the code with cmake and make build and it worked. But when I try running the executable I get:
""
GLX: GLX version 1.3 is required
Could not create glfw window
"""
How do I fix this. I am connecting to cdf using the nx client so I can see the visual displays

Question about "model.glsl" and "model_view_projection.vs"

Hi,

I'm wondering if there should be another translation "t" input for the model function, since model expects translate and "model_view_projection.vs" only expects model.
Or should we just hard code the translating unit into the file.

Thanks.

Confused with the input of snap_to_sphere.tes

In snap_to_sphere.tes, the input of the function is indicated as

//                    array of 3 3D path corner positions
in vec4 pos_es_in[];

The outputs of the function are

// Outputs:
//                   projected, view, and model transformed 3D position
out vec4 pos_fs_in;
//                        view and model transformed 3D position
out vec4 view_pos_fs_in;
//                      view and model transformed 3D normal
out vec3 normal_fs_in;
//                      3D position _before_ applying model, view or projection
//                      transformations (e.g., point on unit sphere)
out vec3 sphere_fs_in;

It seems that the outputs are all information about a single points. If this is the case, what should we do with the input triangle?
Thanks.

Output Verification of part 06 and 07

For test-06 and test-07, do we need to generate the completely same output animation as it is on the website to get full mark? More specifically, do we need to create the exact same marble texture in part 06 and the bumpy appearance of planet in part 07 as the sample animation?

ReadMe typo?

Under the topic Tesselation Control Shader...
" the number of new edges each input each should split into (gl_TessLevelOuter[1] = 5 means the edge across from vertex 0 (i.e., the edge between vertices 0 and 2) should be split into 5 edges); "

Do you mean "the edge across from vertex 1 " instead?

Typo in smooth_heaviside?

In smooth_heaviside.glsl, $t$ is described as:

//   t  control steepness of step function: --> 0 more linear, --> inf more like
//     Heaviside function (piecewise constant function x<0--> -1 , x>0 --> 1)

However, when I was trying to plot the function, it seems that the boundary point should be 0.5 instead of 0.
img1

error: file has changed since the latest compilation

When I run the executable on Visual Studio in Windows, opengl reports it cannot read the "test-01.json" file and says "file has changed since the latest compilation attempt". I didn't change the file at all. I also tried doing a clean build of all the files again and then running the application but still no luck, I get the same message.

Anyone know how to fix this?

Very difficult to read math equations

I find that the math equations for this lab's extremely difficult to read. (Ex: in the bump mapping section) I have also tried reading from the source README.md but I also still find it difficult to read as it is cluttered with cryptic symbols like mathbf, \, weird spacings and all that.

Are there outside references in which we could get the equations from? If not, how can we improve the readability of the math equations in the readme?

This same issue was already brought up by multiple students since the first assignment during the tutorial session but the TA's just told us to try and read from the source README.

Thanks!

Marble?

Hey, I am a bit confused about the marble implementation. According to the description, the marble texture is only an example, so as long as our output satisfied

adds a procedural color to the objects. The color should not change based on the view or model transformation.

we should be fine even the find appearance does not look like marble right? I would like to leave the marble implementation to the last if it is not required as the schedule is pretty tight these days...

normal_fs_in value changed?

Hi,
I just encountered a weird thing. I normalize the normal_fs_in in the snap_to_sphere.vs, which is the normal vector of the transformed interpolated vertex in view coordinate system. Then when I was doing lit.fs, I am using blinn-phong in the view coordinate system, and I assumed the normal vector which is normal_fs_in should've been already normalized and it's good to go. However, the result has obvious artificial effect similar as #14 , #24 . And if I do normalize(normal_fs_in) in lit.fs again, I could get a smooth lighting as we expected. Why this happens?
Here is the result with normalize in lit.fs
image
Here is the result without normalize in lit.fs
image
Both of them have normal_fs_in normalized in snap_to_sphere.vs
Thanks

Missing includes in header files

Hi, the build is failing under MacOS.

Reproduction steps:

  1. clone directory
  2. run mkdir build; cd build; cmake ..; make
  3. build fails

Can be fixed by adding the following include statements in the header files

  • #include <iostream> to ./include/print_program_info_log.h
  • #include <fstream> to ./include/create_shader_program_from_files.h

smooth_step function

the criteria for the smooth_step function applies to many functions.
Is this function analogous to the weighing function mentioned in the book?

thanks

snap_to_sphere.tes clarification

I am not sure what it means to "snap the vertices .. to the unit sphere".
Also, is that supposed to be done before or after interpolation?

thank you

Question for procedural_color.glsl

I think I have finish implementing the peril_noise correctly, however i'm not sure how I'm supposed to get the same exact pattern as the one in the Readme. Also, I am not fully sure on what is expected to earn full marks?

Are we required to mimic exactly the drawing to get full marks or as long as we can show how to manipulate or change the texture of the planet we are good?

Or can you give some guidance in order to verify that we have the correct implementation? Thanks!

Issues on running assignment in Windows

I cmake this assignment with windows but when I ran the assignment I received:

PS computer-graphics-shader-pipeline\build_windows\Release> .\shaderpipeline.exe ..\..\data\test-01.json

Usage:
  [Click and drag]  to orbit view
  [Scroll]  to translate view in and out
  A,a  toggle animation
  L,l  toggle wireframe rending
  Z,z  reset view to look along z-axis
OpenGL version recieved: 3.2.0
Supported OpenGL is 3.2.0 - Build 23.20.16.4973
Supported GLSL is 1.50 - Build 23.20.16.4973
..\..\data\test-01.json has changed since last compilation attempt.
-----------------------------------------------

there is a black window popping up but then it stuck there with no errors. Do I miss anything here?

And I have installed OpenGL Extensions Viewer, it says the OpenGL Version is 4.5, but why is the OpenGL version recieved is 3.2.0? is that a problem?

Tangent calculation

How can we find the tangent vector when we don't have access to the other vertices in the fragment shader? I am given the unit normal vector n = (n1,n2,n3) and only know that n1(x-x0)+n2(y-y0)+n3(z-z0)=0 for some point (x0,y0,z0) on the tangent plane. Please help!

Perlin Noise

For perlin noise, there's the hash function P that maps to a number from 0 - 256 and then the output of that is then the input to G. I found that there's a preset P array with a specific permutation of the numbers from 0 -256 but when I try to use that, the shader is super slow. Are we supposed to use random_direction instead of G[P[i+P[j+P[k]]]? I know in the improved version we don't have to generate a random output of G but we still need to use P and I don't know how I can use an array of numbers unless a texture is created and passed into the fragment shader which I don't think we can do.

clarification on improved_perlin_noise ranges

At the start of the file, there is a comment that states

Values between -½ and ½ ?

Isn't the range of the perlin noise should be [-sqrt(N/4),sqrt(N/4)] where N is the dimension.
So in our case N would be 3 ?

Issue on GLSL 4.10 is not supported

When I ran ./shaderpipeline ../data//test-01.json, I got the following errors:

$ ./shaderpipeline ../data//test-01.json

Usage:
  [Click and drag]  to orbit view
  [Scroll]  to translate view in and out
  A,a  toggle animation
  L,l  toggle wireframe rending
  Z,z  reset view to look along z-axis
OpenGL version recieved: 3.3.0
Supported OpenGL is 3.3 (Core Profile) Mesa 19.0.8
Supported GLSL is 3.30
../data//test-01.json has changed since last compilation attempt.
-----------------------------------------------
../src/version410.glsl has changed since last compilation attempt.
-----------------------------------------------
ERROR: failed to compile vertex shader
0:1(10): error: GLSL 4.10 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.50, 3.30, 1.00 ES, and 3.00 ES

failed to create tessellation control shader
failed to create tessellation evaluation shader
ERROR: failed to compile fragment shader
0:1(10): error: GLSL 4.10 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.50, 3.30, 1.00 ES, and 3.00 ES

error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shader
ERROR: Failed to link shader program
-----------------------------------------------

It says GLSL 4.10 is not supported, what should I do here? Any help?

model_view_projection.vs

in model.glsl, it says "expects: identity, rotate_about_y, translate, PI"

in my mode_view_projection.cpp, I can only get the correct picture if I do something like
proj * view * (model * vec4(pos_vs_in, 1.0) + translation);

so in my model.glsl, I do "rotate_about_y, scaling" instead.

Am I doing anything wrong here?

Wrong specular highlight

2018-11-10-184916_636x363_scrot

Hey, I tried to implement the blinn phong model and see the following effect. The highlight (spectacular light) looks really rough and different from the example showed. I remembered that in Alec's class, one example (twisted pipe) is showed about this issue: The prof had similar wrong highlight, and after the prof did something, the highlight is being corrected and looks really smooth.

However, I forgot what the professor actually did. According to my rough memory the prof cut several lines of code from one section (vertex shader?) to another section (fragment shader?) and it turns to be right.

May the professor or anyone who remembered say again about what is being done to correct the highlight?

Moon Orbit Model

Is the moon also supposed to be orbiting about itself? It appears as so in the gif.

model.glsl Speed of animation

Does it matter how fast/slow we make the animation run or should the moon finish a full rotation and a full revolution in a specific number of seconds?

Thanks

Blinn-Phong Specular Location

For the Blinn-Phong shading, I noticed that my specular highlight doesn't seem to be appearing in the centre of the diffuse coloured section (though moving the view around also moved the specular highlight around). I'm wondering if this is something that I'm doing wrong, or if it's just like that (the gif in the readme also seems to have the same issue).

planet

Adding Perlin Noise to Texture

Once we calculate the perlin noise value, how do we add it to our color texture?
Say I already have obtained a vec3 color vector by calling bling-phong, how do I append my noise value to the color vector?

Perlin noise odd output

My perlin values don't look very random
perlin
and I am not sure why. Any one encountered a similar issue?

bump.fs understanding

Hi Professor,

For bump.fs, I have followed all of the instructions and steps to calculate the normal (also Implemented the improved perlin noise). However i keep on getting a completely different result than the one in the README. Also with openGL, it's significantly harder to debug (can't simply print values on screen).
Here is a screenshot of my completely wrong results:
screen shot 2018-11-08 at 9 00 28 pm

I have also researched into setting up a TBN matrix but to no avail, it still produces a completely different result. I feel like I'm getting stuck in a loop trying after trying to read the many different articles online back and forth and the book doesn't really touch upon this topic either.

Am I going in the right direction? Also, am I overthinking the problem?

model.glsl

In seems in readme, it it missing this file but we need to implement this one...

How to get the effect of cloud?

In planet.fs, I cannot see how to make the effect of the cloud, especially:

  1. How to make the cloud rotate
  2. How to make the cloud semi transparent

Right now I have something like this:
2018-11-12-223737_644x364_scrot

Also, I am wondering what is the marking scheme for the last one? Could my current output get full mark? I really need to balance my time and begin with my other assignments...

smooth_heaviside

On the README, smooth_heaviside is listed as one of the functions that should be implemented but the function is already implemented.
Do we need to make any modifications to this function?

Clarification on Functions to Implement

Good evening,

Just to clarify, are we supposed to:

  1. Implement tangent.glsl
  2. Not implement smooth_heaviside.glsl

I don't recall using anything that would need smooth_heaviside, but it is part of the MarkUs submission list and tangent is not. Can I get a clarification on what actually needs to be done?

Thanks,

  • A.T.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.