Problem with smooth jme, lwjgl gforce 8400 gs

Hello,



I have a big problem with my application on my computer ( it work correctly on other computers but exactly the same on different computer with similar hardware ).



Description:


  • animation isn't smooth
  • bigger screen = less of smooth
  • i've deleted all models and lights and leave only 2 Trimesh and 1 point of light - no effect



    My hardware:
  • Intel Core 2 quad CPU Q8299 2,33 GHz
  • 4 gb rzm
  • win vista 32 bit
  • GForce 8400 GS







    I'm using jme and lwjgl



    Has anyone any idiea whats is going on ?



    Thank You for answer.



    Regards,

    Marcin






marcin__1983 said:

- bigger screen = less of smooth


You mean bigger resolution? Thats expected and normal.

marcin__1983 said:

- i've deleted all models and lights and leave only 2 Trimesh and 1 point of light - no effect


What do you mean with that?

marcin__1983 said:

- GForce 8400 GS


The 8400 is a shitty graphics card and not meant for 3D performance but mainly for video decoding in media centers.

Hm the lower gforce crads cheat with shaders, instead of smoots calcualtion, they use approximate calculations, (like do it for pixel, use it for 10)

Hi dhdd,



About your question:

1 - yea - thats true :slight_smile: .

2 - normally i have 2 models of forklift and 3 models of pallet, board ( just 2 triangle  ), 4 point of lights and a shader.



If i leave only board and 1 point of light annimation isn't smooth as well.  the same if i remove shader. Code of my shader:



vert



varying vec4 diffuse,ambientGlobal,ambient;

varying vec3 normal,lightDir,halfVector;

varying float dist;



void main()

{

vec4 ecPos;

vec3 aux;



normal = normalize(gl_NormalMatrix * gl_Normal);



/* these are the new lines of code to compute the light's direction /

ecPos = gl_ModelViewMatrix * gl_Vertex;

aux = vec3(gl_LightSource[0].position-ecPos);

lightDir = normalize(aux);

dist = length(aux);



halfVector = normalize(gl_LightSource[0].halfVector.xyz);



/
Compute the diffuse, ambient and globalAmbient terms /

diffuse = gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse;



/
The ambient terms have been separated since one of them /

/
suffers attenuation /

ambient = gl_FrontMaterial.ambient * gl_LightSource[0].ambient;

ambientGlobal = gl_LightModel.ambient * gl_FrontMaterial.ambient;





gl_Position = ftransform();

}



frag



varying vec4 diffuse,ambientGlobal, ambient;

varying vec3 normal,lightDir,halfVector;

varying float dist;





void main()

{

vec3 n,halfV,viewV,ldir;

float NdotL,NdotHV;

vec4 color = ambientGlobal;

float att;



/
a fragment shader can't write a varying variable, hence we need

a new variable to store the normalized interpolated normal /

n = normalize(normal);



/
compute the dot product between normal and normalized lightdir */

NdotL = max(dot(n,normalize(lightDir)),0.0);



if (NdotL > 0.0) {



att = 1.0 / (gl_LightSource[0].constantAttenuation +

gl_LightSource[0].linearAttenuation * dist +

gl_LightSource[0].quadraticAttenuation * dist * dist);

color += att * (diffuse * NdotL + ambient);



halfV = normalize(halfVector);

NdotHV = max(dot(n,halfV),0.0);

color += att * gl_FrontMaterial.specular * gl_LightSource[0].specular *

pow(NdotHV,gl_FrontMaterial.shininess);

}



gl_FragColor = color;

}



and point of light :



PointLight pLight1 = new PointLight();

pLight1.setDiffuse(diffuse);

pLight1.setAmbient(ambient);

pLight1.setSpecular(specular);

pLight1.setLocation(new Vector3f(15, 30, 15));

pLight1.setEnabled(true);

pLight1.setAttenuate( false );

pLight1.setConstant( 1f );

pLight1.setLinear( .1f );

pLight1.setQuadratic( .8f );



3 - ok. But this is very simple animation. Can I do somethink with this ?

Hi Empire Phoenix



Is there any solution to make animation smooth on this card?



Thankyou for reply.

hey marcin,



Your card should be able to handle that simple scene of course.



One possible distinction to make: Do you have an FPS counter in place? If so whats your framerate? If the framerate is high it might be unsmooth because you do not take the fps into account when animating.

Ok,



I've 28 -30 fps here but lags are very very big. Animation is smoother when i turn off all shaders and set this:



display.setMinSamples( 0 );



But than it don't looks  good.




marcin__1983 said:

Ok,

I've 28 -30 fps here but lags are very very big. Animation is smoother when i turn off all shaders and set this:

display.setMinSamples( 0 );

But than it don't looks  good.


Hi Marcin!

Antialiasing is very heavy on the Graphics Card, as is advanced shaders. So if you turn off Shaders and Antialiasing, its a clear sign that your card just can't pull the weight. Please note that this also has nothing to do with jme. It would be the same with any other engine, since Antialiasing and Shading happen exclusively on the Graphics Card.

Please anyone correct me if I'm wrong here.

Under windows7 my project is also stucking and very unsmooth. When I change the

process-priority to 'high' it is smooth again (as it is in XP). Maybe this helps you as well!?