directional light shader problem

I’ve been tring to get this for a couple hours. I cant seem to get it right. I’m making a sun shader. I want directional light from a position. Its almost there its just off a little. i cant find the issue. can someone please help me. Thanks.

I looked at some tutorials, but its a mess of what version, and what not. i broke the file down as much as possible.
hope it helps.

here is a image of the error. its not in the right direction.


Attachments

simple_directional_light.blend (991 KB)

simple_directional_light.blend (1000 KB)
Is that what you wanted?

PS: your textures were missing, so I added my own.

Yes!! thanks you. I was digging into just that. i’m glad u got it. thnks a lot.

simple_directional_light.blend (1.19 MB)
Oh boy, I really can’t refrain myself from messing around the file :smiley:
I created a strength, distance and light color support in it :stuck_out_tongue:

can u explain what u did? like the order of math. so the issue was that it wasnt in viewspace?

ok so what i’m trying to do is make the windwaker shader. I have a cool toon shader, and now i need to mix these two. My old shader for mario was at the outer edges of the model. the toon shader looks cool, but the effect needs to be stationary. like shadows, instead of fresnel glow.

lighter side is always center. i need it to stay directional. i think it will be cool this way.


Actually, I, myself doesn’t even know how does that work, but I’ve seen this before:
https://en.wikibooks.org/wiki/GLSL_Programming/Blender/Reflecting_Surfaces
and here:
https://en.wikibooks.org/wiki/GLSL_Programming/Blender/Shading_in_View_Space
it seems that by doing normalMatrix * viewMatrix will convert the normal matrix to world space from eye space, but I never exactly know how it works

(forgive me I’m just a 14 kid…)

So… You want to create a “pixelated light” that’s applying to the object?

yup. exactly

simple_directional_light(1).blend (1.01 MB)
This the farthest progress I made currently, the light focuses on the center, but the shading is zig zaggy :no:


(This one was multiress-ed)

was reading about smoothstep. seems like i need a color ramp or something.

got it. it needed to be in the fragshader.


here is an image with the character.


from node to code.

here u go everybody. I’m sure people will like this.
thanks for the help.

Attachments

windwaker_shader.blend (1.13 MB)