Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 29 April 2011 - 06:39 AM
Posted 29 April 2011 - 07:09 AM
Posted 29 April 2011 - 07:26 AM
Interested in Fractals? Check out my App, Fractal Scout, free on the Google Play store.
Posted 29 April 2011 - 09:09 AM
>An angle is only what you described (the arc-cosine of the normalized inner product). It seems to me that what you want to do is something like applying a rotation that will make the normal be (0,0,1) and see where >the light vector ends up. However, that's still ill specified: The angle between the normal and the light is well defined, but the other one requires having a full reference frame, not just a normal vector.
>
Posted 29 April 2011 - 10:04 PM
>The foot of the image you just posted explains the problem I raised: You need a tangent vector t with respect to which the phi angles will be measured.
>
Posted 30 April 2011 - 06:39 AM
No, I can't. There are many many ways of assigning a tangent for each point on the sphere (in Math such an assignment is called a foliation).>
>The foot of the image you just posted explains the problem I raised: You need a tangent vector t with respect to which the phi angles will be measured.
>
Yes thats true I need a tangent vector.
Can you please tell me how to get the tangent for each point on the sphere given the normal vectors at each point as described earlier?
You change coordinates so the surface is now tangent to z=0 and you can then ignore the z coordinate and compute angles in 2D.And how will I get the desired angles after that?
Is this method of getting tangent correct?
given Normal = N = (n1,n2,n3)
V' = ( 0,-n3, y ) if n1 is the smallest
( -n3, 0, n1 ) if n2 is the smallest
( -n2, n1, 0 ) if n3 is the smallest
V = normalize(V')
W = N x V
Posted 30 April 2011 - 09:09 AM
Posted 30 April 2011 - 09:41 AM
No, I can't. There are many many ways of assigning a tangent for each point on the sphere (in Math such an assignment is called a foliation).
You can't find a way to assign a reference tangent vector so no discontinuities appear, since every continuous 1D foliation on the sphere has a singularity.
Posted 30 April 2011 - 11:28 AM
To render the BRDF from MERL i need to index into the BRDF data. For that purpose I need to calculate local theta_IN, phi_IN and local theta_VIEW, phi_VIEW at each point on the sphere.
Although the MERL data is isotropic but still I want to have all the above four angles calculated.
Posted 30 April 2011 - 11:53 AM
x = cos(phi) * sin(theta)
y = sin(phi) * sin(theta)
z = cos(theta)
phi = atan (x/y)
theta = atan( sqrt(x^2 + y^2) / z^2)
Posted 30 April 2011 - 12:21 PM
But what I need is a angle between two 3D vectors one of which is a normal vector N and the other can be a Light vector or a view vector.
This angle is simple to measure with acos stuff as I described in my first post.
Posted 30 April 2011 - 01:05 PM
Can you tell us why you need this angle in the first place?
I'm still not totally sure what you're attempting to do - is it not just getting light direction and view vector in spherical coordinates?
Posted 30 April 2011 - 01:27 PM
Can you tell us why you need this angle in the first place?
I'm still not totally sure what you're attempting to do - is it not just getting light direction and view vector in spherical coordinates?
Well a BRDF is a 4D function at each point on a surface such as theta_IN phi_IN and theta_VIEW and phi_VIEW.
Posted 30 April 2011 - 09:05 PM
Ok, so what are IN and VIEW?
Posted 01 May 2011 - 05:00 AM
Ok, so what are IN and VIEW?
Well the IN direction is the light source direction calculated w.r.t to the surface normal and the VIEW direction is also w.r.t to the surface normal at a each point on the sphere.
Please see figure I posted of the arrangement in one of the earlier posts.
The concept is very simple I hope you are not lost any more.
Posted 01 May 2011 - 11:33 AM
Looking at the example code that MERL provides for reading its BDRFs, it looks like the the required angles are not in tangent space as you seem to be implying, but rather in object space, accessed by what they call 'half vector difference' coordinates...
They provide example code to map between 'standard coordinates' which appear to just be spherical coordinates, and their special coordinate system... I take it this is no good to you?
Cheers, Paul.
Posted 01 May 2011 - 12:08 PM
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.