dilevin / computer-graphics-shader-pipeline

Computer Graphics Assignment about the Shader Pipeline
2 stars 5 forks source link

Perlin noise #8

Closed harrychy8 closed 5 years ago

harrychy8 commented 5 years ago

capture My earth got cut into 8 parts, not sure why this happened. Below is my mix code capture

csc418-anon commented 5 years ago

I posted a similar issue I was having in issue #7. Seems like I was doing it some-what right, just got my math wrong, but unfortunately both of us have similar problems.

Follow up question for you. How are you getting the color? I'm multiplying the Perlin Noise by the diffuse, and it looks there isn't any color. It may seem like an obvious question, but having trouble validating my math if the color isn't showing. Where am I screwing up? Been stuck on this for longer than usual....

ACalza commented 5 years ago

@csc418-anon You gotta mess around with functions inside procedural colour. For example mess around with sin and cos functions inside the diffuse, that's probably why you're getting messed up colours.

I have the same issue, except it's kind of split in triangles....I'm posting here just to get notifications lmao. But I think it may have to do with the random_vector function. I'm tinkering with it, and it seems to look better after using PI.

image

EDIT: @harrychy8

Your code looks fine, however I think you're mixing in the wrong order, IE d0, g0 might be reversed. I tried reversing it for the sake of it and I get exactly what you get:

image
rin-23 commented 5 years ago

your code looks correct. Are you sure each xyz values of your gradient varies between [-1,1] ? also are you sure your d* vectors are calculated properly. I think smth is wrong with one those vectors.

harrychy8 commented 5 years ago

@csc418-anon You gotta mess around with functions inside procedural colour. For example mess around with sin and cos functions inside the diffuse, that's probably why you're getting messed up colours.

I have the same issue, except it's kind of split in triangles....I'm posting here just to get notifications lmao. But I think it may have to do with the random_vector function. I'm tinkering with it, and it seems to look better after using PI.

image

EDIT: @harrychy8

Your code looks fine, however I think you're mixing in the wrong order, IE d0, g0 might be reversed. I tried reversing it for the sake of it and I get exactly what you get:

image

I tried to reverse them but I got the same thing. I really do not know what is going on LOL. I have tried to rewrite this part for over 4 times.

ACalza commented 5 years ago

Wherever you're splitting the fractional and non-fractional position is where you're messing up. Your math was probably right the entire time. But I assume you figured this out by now, but might as well post just in case.