Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 01 Feb 2013
Offline Last Active Feb 09 2016 08:06 AM

Topics I've Started

Blending settings question

04 December 2015 - 07:47 AM

Hello everybody,


As you can see in the picture, I'm rendering a serie of cylinder which are dynamically moving. It's to show a sort of 3d path.

Anyway, I want them transparent like how they are right now but as you can see where they overlap of course there is an artifact I'd like to get rid of.

I'm using the usual settings: source = source_alpha and destination = one_minus_source_alpha.


Is there any state settings or any way to have the same transparency everywhere for those overlapping cylinder ? So where they intersect the alpha is not taking any other cylinder into account.


Cheers !


Fbx light attenuation

31 July 2015 - 08:47 AM



I'm currently adding light attenuation to my shaders. (forward rendering)

The formula I'm using is the following:

attenuation = 1 / (attConst + attLinear * dist + attExp * dist * dist);


Now the real problem is how to put Fbx values in relation to that formula.


So far I have plugged what fbx call DecayStart as my attExp variable. It seams DecayStart is in the range 0..100 so I'm multiplying it by 0.01


Now I think this is not really what maya or 3dsMax are doing...


Fbx has also:






So now I'm really not sure how to compute all those, I mean I could invent something of course but I'd prefer something that is commonly used.

Is there a new attenuation formula I should use ? 

Does anybody know Fbx enough to teach me how to plug all those variable together in a nice attenuation function.


Thx a lot.

Better way for geometry problem

23 April 2015 - 02:42 AM

Hi, I am wondering if there is a better way to my problem as the solution I found seems not optimal.


Looking at the picture, I need to know the 3d position of E and F.


Here's what I do know:


B is my camera position.

A and D are known and moving in world space, so I also know AB and AD.

I also know the radius of each spheres.


Here the solution I found:


I compute angle alpha knowing AB and AC.

Then I compute the angle BAD with the dot product of the two vector... This is the part I'm not sure as it is suppose to give me the cos of BAD I hope.

Then I compute CAE doing the difference between BAD and alpha.

Then knowing CAE I can compute the hypothenuse AE.


Repeat the operation for the second sphere and I finally get F.


Any better, clever way ?


Thanks to all you maths guys.

True object billboarding problem

03 March 2015 - 06:47 AM



I'm in trouble trying to do object billboarding to display bones hierarchy.

Question 1 : should I do the billboarding first and then TRS to match the bone position rotation and size or, should I do the TRS first, which I've done already and then rotate around bone axis to align the bone mesh in front of the camera ?


Question 2 : I'm trying to do billboarding with a mesh, here are my steps:

1- get the vector object to cam in world space

2- project it on XZ plan by setting its y component to 0

3- normalize it (objToCamProj)

4- get alpah the dot between forward(0, 0, 1) and objToCamProj

5- get the up vector from cross(forward, objToCamProj)

6- create a rotation axis out of up and rotate each vertex by acos(alpha)

7- transform vertexPos by the model, view and proj mat


Ok now I think the method should be correct BUT, when rotating the camera around my object, it's fine as long as I'm within the positive Z. As soon as the cam pos is going into negative Z, the rotation angle seams like inverse or something.


What am I missing ? (I know for now it's only cylindrical billboard and regarding question 1 I'm doing billboard then TRS)


Any help would be much appreciated.


Mesh matrix transformation question

17 February 2015 - 07:36 AM



I have a mesh which is quika like a cylinder.

When I render it without its local transform, just with an identity matrix, its base is not in 0.0 but in 0.4 and it points toward the -Z.

Then, when I render it with its local transform, it points toward +y and its base is still at 0.4 (just above the origin).


Now, what I need to do is to stretch it in length but without touching those 0.4 from the origin.


I tried so many combinaison now I don't even know if it's possible.


I tried to use its inverse local matrix then scale it then multiply it by its local matrix to put it back etc...

But whatever I'm doing, it's also stretching those 0.4 from the origin so if I scale it 2 times, it puts it at 0.8 from the origin.


I understand I need to cast it in some space where its base would be at the origin, then do the scaling and put it back to where it should be but I can't figure out how to do it with the matrices.


Any help, idea would be much appreciated.