Jump to content

  • Log In with Google      Sign In   
  • Create Account

thedodgeruk

Member Since 30 Jun 2010
Offline Last Active May 14 2013 11:06 AM

Posts I've Made

In Topic: tessellation shader crash

24 May 2012 - 05:59 AM

thanks for the help , finally figured it out and it was a very stupid mistake, project was originally dx10
when i ran it in debug layer mode , and checked exactloy what was happening , in my post processsing stage , it said there was a mismatch will vertex and hull shader , which not make sence cause im not setting the hull shader aprt from the models which tesselate.

that makes sense until i realised im not resetting the hull shader to NULL.
that was the problem , cheers

In Topic: was wondering , has any one used myGui?

26 February 2012 - 11:05 AM

is there a good tutorail on how to use cmake , tryed it a few times and the amount of link errors are pretty bad
just wish there was a pre-compied myGui out there for direxctx and visual studio

In Topic: Next generation renderer design.

24 November 2011 - 06:44 PM

i not sure what your asking here , im part way through doing my engine for my final year degree , and what you are asking is the whole system by sound of it

you say you have done several renderers before , go back a nd find out were they fell short of the idea you had ,
you need to make it so its loose coupling and easy to change.

"We also want shaders and textures to be able to be swapped in at realtime" this is very easy to acheive with very little coding . all depends on how you design your enitre code to allow for the flexability

In Topic: can you assign an enum to a memory address of a shader?

12 November 2011 - 05:44 PM

You can only assign constants to the identifiers in enumerated types so that doesn't work.

You can define the enumerated type then force the loaded shaders to that index.


enum EShader
{
	phong,
	normal
};

//Then when you load it

if (name == "phong")
{
	assignAddress(phong);
}



not sure how that works

,
with the way i did it it has to do a search of the map stl each time,
i would like to only do that to begin with , and then it can do it via the enums, or im i going about this wring ?


In Topic: from matrix to radians

05 November 2011 - 08:15 AM

Here's the function I use, translated to C++. I hope I've got it right (I never really used references in C++).

void eulerAnglesFromMatrix(D3DXMATRIX& mat, float& x, float& y, float& z)
{
if(mat.m[2][1]>1)
mat.m[2][1]=1;
if(mat.m[2][1]<-1)
mat.m[2][1]=-1;
x=asin(mat.m[2][1]);
const double epsilon=0.01;
if(x+epsilon<(3.1415926535/2))
{
if(x-epsilon>(-3.1415926535/2))
{
z=atan2(-mat.m[0][1],mat.m[1][1]);
y=atan2(-mat.m[2][0],mat.m[2][2]);
}
else
{
z=-atan2(mat.m[0][2],mat.m[0][0]);
y=0;
}
}
else
{
z=atan2(mat.m[0][2],mat.m[0][0]);
y=0;
}

x=-x;
y=-y;
z=-z;
}



It works well. I had the flip-flop problem with some other methods as well. The epsilon in this method is to counter a strange problem when the object is pointing in one of the cardinal directions, and it is kind of indeterminate as to which solution to use, so the epsilon skews the result to one side or the other. Lastly, the checks on mat.m[2][1] at the beginning are because of floating point inaccuracies - sometimes that element can be something like 1.0000001, when it really should be 1.0, and atan2() will then return a NAN.

[Edited by - Drakex on July 21, 2005 11:13:14 AM]




cheers , this solved a problem that i had

PARTNERS