Search found 33 matches

by TVM Cracklings
05 Oct 2015, 12:55
Forum: How to...
Topic: How to obtain eyeposition in shaders?
Replies: 2
Views: 1346

Re: How to obtain eyeposition in shaders?

Method 1: Use viewspace to compute lighting. This would probably make your program run faster as well.

Method 2: The hard way. Getting Camera position through view matrix. Check out this post on SO.

Hope this helps.
-C
by TVM Cracklings
01 Oct 2015, 14:40
Forum: General Discussion
Topic: "lit" function in HLSL node
Replies: 2
Views: 1739

Re: "lit" function in HLSL node

Hi rou, thank you for your reply. Problem identified. It shouldn't have bin the coord in projection space at all, it was meant to be vPosVS, which was passed per TEXCOORD1. I knew I was doing something silly x) But to make it more clear: If I understand correctly, POSITION0 is the equivalence of gl_...
by TVM Cracklings
30 Sep 2015, 11:18
Forum: General Discussion
Topic: "lit" function in HLSL node
Replies: 2
Views: 1739

"lit" function in HLSL node

Hi there. I was trying to play around with custom lighting models, and immediately encountered the following problem, which should be a really basic one, but I'm really not sure why it works as it is. code: #define pi 3.14159265358979324 float4x4 mMVP : WORLDVIEWPROJECTION; float4x4 mMV : WORLDVIEW;...