Delgine 3D Tools & Content DeleD Community Edition
Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DMF engine and lightmaping

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Community Edition
View previous topic :: View next topic  
Author Message
banshee777
Member


Joined: 10 Feb 2005
Posts: 37

PostPosted: Thu Aug 25, 2005 1:56 pm    Post subject: DMF engine and lightmaping Reply with quote

I can't seem to get lightmapping going.

Isn't the UV values 6 to 11 after lightmapped the second layer, second texture coords?

int brushrender()
{
char crap;
int i = 0;
int j = 0;
int uv0 = 0;
int uv1 = 1;
int uv2 = 6;
int uv3 = 7;
char test;


glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, mtexture[0]);

glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, mtexture[1]);

while (i < mapcore[0].boxes) // MAX OBJECTS etc box, pyramid, etc
{

for (int j = 0; j < box[i].polygons; j++) // render all faces
{
uv0 = 0;
uv1 = 1;
uv2 = 6;
uv3 = 7;

glBegin(GL_TRIANGLES);
//for (int z = 0; z < box[i].vertices[j] && box[i].visible == -1; z++)
for (int z = 0; z < box[i].vertices[j]; z++) //render face
{
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, box[i].uv_values0[j][uv0], box[i].uv_values0[j][uv1]);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, box[i].uv_values0[j][uv2], box[i].uv_values0[j][uv3]);
glVertex3d(box[i].x[box[i].vertice_index_values0[j][z]],box[i].y[box[i].vertice_index_values0[j][z]],box[i].z[box[i].vertice_index_values0[j][z]]);
uv0 = uv0 + 2;
uv1 = uv1 + 2;
uv2 = uv2 + 2;
uv3 = uv3 + 2;
}
glEnd();
}
i++;
}



}
Back to top
View user's profile Send private message
Daaark
DeleD PRO user


Joined: 01 Sep 2004
Posts: 2696
Location: Ottawa, Canada

PostPosted: Thu Aug 25, 2005 3:20 pm    Post subject: Reply with quote

The UV set is the last. In the UV for the triangle you will have 6 for each layer. (Assuming you work with triangles) It's always layer 4
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
banshee777
Member


Joined: 10 Feb 2005
Posts: 37

PostPosted: Thu Aug 25, 2005 9:20 pm    Post subject: ... Reply with quote

I ignored the 4th layer, i'm justing doing 2 layers. Still it should work. Unless the finally UV values are incorrect

1 1 1 1 1 1 last uv values 1 1 1 1 1 1
First texture second texture?

or it's differenent other?
Back to top
View user's profile Send private message
Daaark
DeleD PRO user


Joined: 01 Sep 2004
Posts: 2696
Location: Ottawa, Canada

PostPosted: Thu Aug 25, 2005 9:30 pm    Post subject: Re: ... Reply with quote

banshee777 wrote:
I ignored the 4th layer, i'm justing doing 2 layers. Still it should work. Unless the finally UV values are incorrect

1 1 1 1 1 1 last uv values 1 1 1 1 1 1
First texture second texture?

or it's differenent other?
The foruth layer is ALWAYS the lightmap layer. Regardless if you used layers 2 or 3
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
banshee777
Member


Joined: 10 Feb 2005
Posts: 37

PostPosted: Fri Aug 26, 2005 5:16 am    Post subject: ... Reply with quote

The texture is back to front. It needs to be flipped. Thats why i had these problems.
Back to top
View user's profile Send private message
Daaark
DeleD PRO user


Joined: 01 Sep 2004
Posts: 2696
Location: Ottawa, Canada

PostPosted: Fri Aug 26, 2005 5:27 am    Post subject: Re: ... Reply with quote

banshee777 wrote:
The texture is back to front. It needs to be flipped. Thats why i had these problems.
That's because Deled uses CW triangles instead of CCW.
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Community Edition All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum