Jump to content

  • Log In with Google      Sign In   
  • Create Account

furrymaster

Member Since 07 Jun 2010
Offline Last Active Apr 02 2012 09:58 AM

Topics I've Started

Radeon vs nVidia rendering - game issue

18 March 2012 - 01:38 PM

Hi,
some time ago I wrote simple game which looks like arkanoid. And everything would be fine if not one BIG problem: on nVidia graphic cards my game is rendering everything what i want, but on Radeon you can't see anything else than black background. I dont use any special instructions for shaders or opengl. I use simple VBO + VAO + shader GLSL(#verison 120).

Game:
http://www.wupload.com/file/2676932477/antyNoid.zip

Sample shader:
#version 120
uniform mat4 modelViewProjectionMatrix;
in vec3 in_Position;
void main(void)
{
    gl_TexCoord[0] = gl_MultiTexCoord0;
    gl_Position=vec4(in_Position.xy*2,0,1);
}

Do you have any idea what I am doing wrong? What should I check to know where is difference between using opengl+shader in nVidia and in Radeon? Can it be the problem of shaders? (all are in defaultData of game, some can look stragne because of shader-merging system, but it works fine).

Oh and: I dont get any Opengl/Shader compile errors what is so strange too.

Colision 2D - getting push vector

18 February 2012 - 03:20 AM

Hi, at the moment i'm creating simple physic in my engine and i have problem with 1 thing: when i have colision rect<< >>rect(s) how can I calculate vector which say "if you dont want to colide move for [x,y]". That what I have is: moving rectangle, coliding with it rectangles, move vector of my rectangle and intersect rectangle of each rect-rect colision.
Main problematic colisions are:
Posted Image
As you can see i cannot sum all push vectors because my moving rectangle will be pushed too far away.
So that i'm getting 2 vectors from them which: has "best pushing" for x and for y value but counter to rect move vector.
But it doesnt works well too( I can find an example where it doesnt work ). Do you have any idea what should it do? Maybe i'm going bad way to get "push vector"? Any articles about getting this vector would be nice too.

[Box2D]Problem with joints - simple moving

21 May 2011 - 02:07 PM

Hi, I`m writting because i have problem with using joints in Box2D. I`m trying to create simple moving system for my units but i cannot find out how to move units with this and this speed. I was trying to use linear Velocity but i have to control when units are on place in which i want them. I`ve tried joints but they are working like a... gum? U know, at start they move slow but if they are closer to target position my unit moves faster.
Can u give me an advice how to use joints to have an effect like i want? (i was looking for good tutorial about this but all are with jumping boxes, moving them with mouse or car with wheels:( )

[GLSL] Bump map compression? - artefact

17 September 2010 - 07:38 AM

Hi, i have next problem, now with bump mapping at deferred lighting. Heres screen with artefact:

As you can see my shader makes some kind of marks of bump mapping.

Do u have any advice what kind of my mistake can it be?

here`s my pre (pixel)shader:

varying vec3 normal;
varying vec3 tangentS;
varying vec3 tangentT;
varying vec3 position;

varying vec2 texCoord;

varying float depth;
uniform sampler2D baseTex;
uniform sampler2D normalTex;

void main()
{


vec3 bumpNormal = texture2D( normalTex, texCoord).xyz * 2.0 - 1.0;//bump map load
vec4 base = texture2D( baseTex, texCoord);

bumpNormal = bumpNormal.x * tangentS + bumpNormal.y * tangentT + bumpNormal.z * normal;
bumpNormal = faceforward( bumpNormal, normalize(position), bumpNormal);
normalize(bumpNormal);
bumpNormal= bumpNormal* 0.5 + 0.5;
gl_FragData[0] = vec4( bumpNormal.xy,depth*(bumpNormal.z<0?-1:1),base.a);//here i keep xy normals and depth with sign of normals.z
gl_FragData[1] = vec4( base.rgb,1.0);//material


}



And my dirLight (pixel) shader:
#version 120
#extension GL_ARB_draw_buffers : require
#extension GL_EXT_gpu_shader4 : require

uniform sampler2D normalDepthTex;
uniform sampler2D materialTex;

uniform vec3 lightDir;//=vec3( 0.57735);
uniform vec3 lightColor;//=vec3(0,1.0,0);
void main()
{


vec4 normal = texture2D( normalDepthTex, gl_TexCoord[0].xy);
vec4 mat = texture2D( materialTex, gl_TexCoord[0].xy);
normal.z=sqrt(1-normal.x*normal.x-normal.y*normal.y)*(normal.z<0?-1:1);//get real normal.z value from xy, because in normal.z i have coded depth, i`m only getting sign of z value(which is depth)
vec3 bumpNormal = normal.xyz* 2.0 - 1.0;;
float d = dot( lightDir, bumpNormal);
d = max( 0.0, d) + 0.2;
d = min( mat.w, d);

gl_FragColor = vec4( (d*mat.rgb )*lightColor,1.0);//lightColor is green as u can see at the screen
}


Thanks for any useful advices(how should i resolve this problem).

getting modelView coord

12 September 2010 - 12:26 AM

Hi, i have problem with getting modelView coord in deferred convex geometry rendering.
i`m doing this like that:
vec2 coord=(gl_ModelViewMatrix*gl_Vertex).xy;

and i m getting position like this(with convex cane- spot light):

but it should look like part of this one:


What am i doing wrong?

PARTNERS