What's new

N64 Glide Plugin

Status
Not open for further replies.
OP
Dave2001

Dave2001

Moderator
Whoa!! That's absolutely AWESOME!

Yeah, try updating your drivers, see if it works. Also, make sure that you are only running Mario 64. That's the only game that works. Glide3x.dll should be in the system directory (or the directory you run the program in).

By the way, I just got textures working (and mapped to the objects correctly). I'll be starting on texture blending in a few minutes.
 

Cyberman

Moderator
Moderator
Dave2001
Yeah, try updating your drivers, see if it works. Also, make sure that you are only running Mario 64. That's the only game that works. Glide3x.dll should be in the system directory (or the directory you run the program in).

By the way, I just got textures working (and mapped to the objects correctly). I'll be starting on texture blending in a few minutes.
Wow.. heh.. you are progressing faster than I did on my soft GPU for the PSX, then again I haven't worked on it in a bit (grins). Trying to do it in MMX mostly I think I messed a few things up ;)

Cyb
 
OP
Dave2001

Dave2001

Moderator
Ok, I'm sure someone has had this happen to them before:

When objects go off the screen and are clipped, the texture perspective gets totally warped. Does anyone know how to fix this?

(by the way, I know the colors are wrong on shadows and mario, and there is no transparency, but these are very easy things to fix. I just haven't gotten around to them yet.)
 
OP
Dave2001

Dave2001

Moderator
By the way LoneRaven, what is your AOL IM handle? I tried KingDavid44 and it didn't work. I have no way of contacting you since you aren't on my contact list yet.
 

Cyberman

Moderator
Moderator
Dave2001 said:
Ok, I'm sure someone has had this happen to them before:

When objects go off the screen and are clipped, the texture perspective gets totally warped. Does anyone know how to fix this?

(by the way, I know the colors are wrong on shadows and mario, and there is no transparency, but these are very easy things to fix. I just haven't gotten around to them yet.)
well if I remember this problem ( I get it too) you are actually changing the area you are maping the texture too..

IE
you are bound by an initial list of triangles and this triangle changes as you move. So if you cliped on of your objects Say a triangle and one of the points is now outside of viewable range.. you need to break that triangle into 3 triangles one where the EDGE of the cliping begins and two which were your original vertices that are still viewable. A halfway point between these two vertices constitutes the point on the edge triangle (the edge triangle is a triangle whose edge constitutes the cliped portion of the original triangle). You have to Chunk the orignal texture appropriately with the new 'triangles'

This was a pain for me to fix on my soft GPU .. I figured it out but never implemented it due to lazyness! ;)

I wanted to color to work first go figure ;)

Cyb
 
OP
Dave2001

Dave2001

Moderator
I assume you mean a triangle strip approach as in [figure A] rather than my current triangle fan approach [figure B]. This is what you mean, isn't it? How would you divide the triangle in a case like [figure C]? or would you leave it as it is? I think one vertex has been on the screen before, and it was still warped.
(green is the screen's right edge)
 
Last edited:

Azimer

Emulator Developer
Moderator
I would imagine both methods would work fine. This might sounds stupid... but are you sure you are redoing the texture coordinates correctly as well?
 
OP
Dave2001

Dave2001

Moderator
Yes, I am.

Here's basically the clipping code (one side only, sorry it's so long). It's really simple once you look at it. Don't pay attention to the vertex buffer stuff, buffer 2 is where you are copying from, buffer 1 is where you are copying to, n is 3 for the first clipping.

Look here if you want to see where I got it from:
http://www.voodooextreme.com/glide3tutorial/html/tutorial19.htm

After I do the clipping, I draw the points as a GR_TRIANGLE_FAN.

#define Vj rdp.vtxbuf2[j]
#define Vi rdp.vtxbuf2

int i,j,index;
float percent;

if (rdp.clip & CLIP_XMAX) // right of the screen
{
// Swap vertex buffers
VERTEX *tmp = rdp.vtxbuf2;
rdp.vtxbuf2 = rdp.vtxbuf;
rdp.vtxbuf = tmp;
rdp.vtx_buffer ^= 1;
index = 0;

// Check the vertices for clipping
for (i=0; i<n; i++)
{
j = i+1;
if (j == n) j = 0;

if (Vi.x < rdp.scissor.lr_x)
{
if (Vj.x < rdp.scissor.lr_x)
// Both are in, save the last one
{
rdp.vtxbuf[index++] = Vj;
}
else
// First is in, second is out, save intersection
{
percent = (rdp.scissor.lr_x - Vi.x) / (Vj.x - Vi.x);
rdp.vtxbuf[index].x = (float)rdp.scissor.lr_x;
rdp.vtxbuf[index].y = Vi.y + (Vj.y - Vi.y) * percent;
rdp.vtxbuf[index].z = Vi.z + (Vj.z - Vi.z) * percent;
rdp.vtxbuf[index].u = Vi.u + (Vj.u - Vi.u) * percent;
rdp.vtxbuf[index].v = Vi.v + (Vj.v - Vi.v) * percent;
rdp.vtxbuf[index].b = (BYTE)(Vi.b + (Vj.b - Vi.b) * percent);
rdp.vtxbuf[index].g = (BYTE)(Vi.g + (Vj.g - Vi.g) * percent);
rdp.vtxbuf[index].r = (BYTE)(Vi.r + (Vj.r - Vi.r) * percent);
rdp.vtxbuf[index++].a = (BYTE)(Vi.a + (Vj.a - Vi.a) * percent);
}
}
else
{
//if (Vj.x >= rdp.scissor.lr_x)
// Both are out, save nothing
if (Vj.x < rdp.scissor.lr_x)
// First is out, second is in, save intersection & in point
{
percent = (rdp.scissor.lr_x - Vj.x) / (Vi.x - Vj.x);
rdp.vtxbuf[index].x = (float)rdp.scissor.lr_x;
rdp.vtxbuf[index].y = Vj.y + (Vi.y - Vj.y) * percent;
rdp.vtxbuf[index].z = Vj.z + (Vi.z - Vj.z) * percent;
rdp.vtxbuf[index].u = Vj.u + (Vi.u - Vj.u) * percent;
rdp.vtxbuf[index].v = Vj.v + (Vi.v - Vj.v) * percent;
rdp.vtxbuf[index].b = (BYTE)(Vj.b + (Vi.b - Vj.b) * percent);
rdp.vtxbuf[index].g = (BYTE)(Vj.g + (Vi.g - Vj.g) * percent);
rdp.vtxbuf[index].r = (BYTE)(Vj.r + (Vi.r - Vj.r) * percent);
rdp.vtxbuf[index++].a = (BYTE)(Vj.a + (Vi.a - Vj.a) * percent);

// Save the in point
rdp.vtxbuf[index++] = Vj;
}
}
}
n = index;
}
 

LoneRaven

Glide64 Website Guy
I am sorry about that, KingDavid44 was my temp account an I forgot to change it. You can get a hold of me in two ways:

Email: [email protected]
AIM: LoneRaven12

I would have replied earlier but the board was down yesterday.
 
OP
Dave2001

Dave2001

Moderator
Actually, I take what I just said back. Vertex colors are hard to tell if they warp. When I map the vertex colors to objects, they warp also. The answer probably is within my clipping (posted earlier).

(said earlier that vertex colors worked)
 
Last edited:
OP
Dave2001

Dave2001

Moderator
BTW, get the new version here if you want to see what the problem is (don't pay attention to the combine errors, I know mario is invisible)
 
OP
Dave2001

Dave2001

Moderator
Also, I think the zbuffer artifacts are caused by the same thing that causes the texture warps. I think that my method of clipping doesn't work very well. Can someone give me a new method?
 

Cyberman

Moderator
Moderator
Dave2001 said
Also, I think the zbuffer artifacts are caused by the same thing that causes the texture warps. I think that my method of clipping doesn't work very well. Can someone give me a new method?
Are you using a cliping volume and finding the slope intercept on the volume edges to find the end points of the polygons?

Heh.. I remember this stuff 10 years ago :)

I'm feeling old suddenly

Cyb
 

icepir8

Moderator
:tr64:
Dave,

I'm willing to help you in anyway I can. I have a banshee based video card I can install in a computer for testing. Let me know.

Cheers,

Icepir8
 
OP
Dave2001

Dave2001

Moderator
Yeah, I've got lots of others on my contact lists also, I might need to create a list of who's who and has what card.
 

LoneRaven

Glide64 Website Guy
Voodoo 3 AGP - Primary

Voodoo Banshee - Not currently in, but could be done with a little bit of time

Voodoo 5 AGP - I am not sure but can probably make it work out to have it be tested
 
Status
Not open for further replies.

Top