Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

varying variables #6

Open
addlistener opened this issue Jul 23, 2016 · 5 comments
Open

varying variables #6

addlistener opened this issue Jul 23, 2016 · 5 comments

Comments

@addlistener
Copy link

Where in the question body did you find vTop, vLeft, vRight variables? There's no code about it in vertex.glsl....

@drewlustro
Copy link
Owner

which challenge are you referring to?

@addlistener
Copy link
Author

Challenge "Varying variables"

@drewlustro
Copy link
Owner

I honestly have no idea; I answered about half of these questions nearly 2 years ago. Some of the answers were produced with much internet googling and frustration.

I even filed an Issue with the shader-school repository maintainers about the lack of sufficient information & clues to answer some of the problems.

stackgl/shader-school#106

Unless they've vastly updated the project, I suspect there are still such problems with shader-school.

Generally speaking though, I cannot complain because it was an excellent introduction to shaders. Once you get to the questions on lighting models though, everything really falls apart.

@idchlife
Copy link

Lol I tried like dividing different axis to colors .r .g .b to get the answer done.

How one suppose to find that coordinates are 100.0?! I thought they will be like 1.0 max since rgb is 0.0 - 1.0
And that's just a scratch of a mountain.

So vLeft, vTop etc must be set for exercise to process them so color can be set behind the scenes accordingly, yes? Dear god. I thought I'm stupid for not getting how to get colors right.

Are there better interactive tutorials about shaders out there?

@WWRS
Copy link

WWRS commented Dec 17, 2017

Better way of figuring that one out:

if (position.y > 0.0) {
  // Top
} else if (position.x > 0.0) {
  // Right
} else {
  // Left
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants