Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Do Jul 10, 2025 12:30

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 33 Beiträge ]  Gehe zu Seite Vorherige  1, 2, 3  Nächste
Autor Nachricht
 Betreff des Beitrags:
BeitragVerfasst: Mo Mai 21, 2007 20:33 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
As an extra test i downloaded the files from the site again and i have an texture on the head.

Must be the glBitmap then. As the version of glBitmap i have needs Dest.ptRed^ and not Dest.Red. I wil try the latest glBitmap now.

[EDIT]

I downloaded the glbitmap.pas again from http://www.dev-center.de/index.php?cat= ... e=glbitmap
the version is 1.8.10. And it works with gl3ds as downloaded from http://www.noeska.com/downloads/vclgl3ds_5b.zip .

What is your brand of video card and what drivers are you using?

[/EDIT]

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Mai 21, 2007 20:47 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jan 24, 2007 00:44
Beiträge: 144
I'm starting to agree with you now. I copied the .exe to a different machine and, guess what?, I got half a head!!!

Half a head!!! The top half of the head!!!

Can you believe it?

Will repost when I've checked a few things!

_________________
Cheers, DpM
http://www.hmusiccentre.org.uk


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Mai 21, 2007 21:06 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
the latest glbitmap with the latest gl3ds release renders your mesh correctly on my laptop. So if you are also using the latest glbitmap that is not to blaim.

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: ...
BeitragVerfasst: Mo Mai 21, 2007 21:28 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jan 24, 2007 00:44
Beiträge: 144
Great.

I have an ATI Mobility Radeon 9000 (Thinkpad) in my development box, driver date is 25/05/2005 and version is 6.14.10.6546. I guess I will try and scour for an updated driver... might prove difficult as the phrase I heard on my first limited search was that it appears to be 'driver dead'.

The card in my media centre is an ATI Radeon X300 Series (probably another piece of crap), the driver date is 22/02/2005 and version is 6.14.10.6517. I'm downloading version 7.4 now I think... let's see what kind of mess I can create...

_________________
Cheers, DpM
http://www.hmusiccentre.org.uk


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: !
BeitragVerfasst: Mo Mai 21, 2007 22:36 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jan 24, 2007 00:44
Beiträge: 144
So, the old lesson of 'latest drivers' comes back to bite...

I upraded the drivers on my media centre and I now see the texture on the head of the model. Success; and I'm glad it had nothing to do with code at the end of the day. This probably means I can usefully use gl3ds for my skeletal animation needs.

I might not have as much luck with the drivers for my laptop.

_________________
Cheers, DpM
http://www.hmusiccentre.org.uk


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: Ouch!
BeitragVerfasst: Mo Mai 21, 2007 23:24 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jan 24, 2007 00:44
Beiträge: 144
Well, noeska - I'd like to say thanks for all the help and apologise for the wasted time (no time is ever wasted, is it?).

I upgraded the laptop Radeon Mobility 9000 driver to 6.14.10.6547 dated 16/11/2006 and I still get a white head where my face.jpg texture should be. I doubt there is going to be a later driver than that and I think I'm lucky I found that to be honest - ATI certainly don't provide it.

What an annoyance.

As I say, my ms3d reader can display the model (no animation) with all textures. I am confused to say the least. I'll quickly check out whether Sulaco's tutorial (http://www.sulaco.co.za/opengl_project_ ... mation.htm) can be persuaded to load this model correctly, although I have little hopes for success.

Choices I appear to have...

1) Continue with my ms3d loader and hope I can work out how to display animations and not mess up the rendering.
2) Continue with gl3ds and just accept I may not see on my development workstation what my users will see on theirs.
3) Dump my crap laptop and get an updated one... hmm... too painful!

Any other ideas?

_________________
Cheers, DpM
http://www.hmusiccentre.org.uk


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Mai 22, 2007 18:04 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
In tall3dsmesh.render try disabling the glMultiTexCoord2f like

Code:
  1. glTexCoord2f(FMapping[FIndices[f]].tu, FMapping[FIndices[f]].tv);
  2. //glMultiTexCoord2f(GL_TEXTURE0,FMapping[FIndices[f]].tu, FMapping[FIndices[f]].tv);
  3. //glMultiTexCoord2f(GL_TEXTURE1,FMapping[FIndices[f]].tu + (lightv1.x*offset), FMapping[FIndices[f]].tv + (lightv1.y*offset));


you have to do this 3 times. For fun you could also comment the glTexCoord2f to see the mesh without textures.

Next in tmaterial.apply
after the first texture.bind place an end with (* like

Code:
  1.     ftexture.Bind;
  2.   end;
  3.     (*


and before //Two Sided Materials place an *)

This should comment out the bumpmapping part.

Also before the first ftexture.bind disable the 2 lines before that like:
//glActiveTexture(GL_TEXTURE0); //MVDH 2005 march
//glenable(GL_TEXTURE_2D);

Now the mesh is only rendered with basic texturing.
On my pc it does not make an difference, but maybe on your pc it may render the head correctly.

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: !
BeitragVerfasst: Mi Mai 23, 2007 00:07 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jan 24, 2007 00:44
Beiträge: 144
OK, I gave this a go. I didn't have much success. I am going to try again tomorrow when less sleepy. Will start again and post a screenshot if I get the same result.

_________________
Cheers, DpM
http://www.hmusiccentre.org.uk


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Mai 23, 2007 15:19 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jan 24, 2007 00:44
Beiträge: 144
Update...

1) In T3dsMesh.Render I commented out six glMultiTexCoord2f API calls.
2) In T3dsMaterial.Apply I commented out the code you suggested after ftexture.Bind.
3) I commented out the other bits you mentioned before the first ftexture.Bind.

Little bit confused because my file (either version I was provided with) doesn't look like the one you reference above near the glMultiTexCoord2f API call, i.e. there is no glTexCoord2f API call preceding these lines.

I got the following...

Bild

...I have included my altered gl3ds.pas here if you want to check the changes I made.

_________________
Cheers, DpM
http://www.hmusiccentre.org.uk


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Mai 23, 2007 15:44 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jan 24, 2007 00:44
Beiträge: 144
Intriguing. Worth adding that I downloaded the Sulaco keyframe animation for Milkshape ASCII tutorial (at http://www.sulaco.co.za/opengl_project_ ... mation.htm), I changed the code from referencing hog2.txt to character2.txt, chucked all the four texture files into the same folder, and I get the model rendered with head and all.

Looks quite stocky... something to do with the perspective I guess. Would still like to get gl3ds working for me though.

_________________
Cheers, DpM
http://www.hmusiccentre.org.uk


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Mai 23, 2007 19:40 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
some work for me to do then.... comparing data before it is being rendered and detect where calculations go wrong in my app.

could you do one favour for me and disable the rendering of the normals. and the part after two sided materials.... just curious as the textures are not to blame these 2 are the next victems (and i bugged normals before).

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Mai 23, 2007 21:17 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jan 24, 2007 00:44
Beiträge: 144
Well, I'm not sure it's your code where the problem lies (I'm still annoyed my card drivers don't appear to be doing things the same as I might expect!) - it's just that with gl3ds at the moment I'm getting different results all the time and I need something I can count on, so I will definitely help you try and get to the bottom of the problem (if it actually exists) any way that I can - please bear in mind, I'm just learning OpenGL stuff so I might not add much value.

Anyway, if you want me to alter code and try things out, shall we make sure that we're working on the same gl3ds.pas codebase? In your previous post where you requested that I comment out stuff... you showed me some code that had three occurrences of:

Code:
  1. glTexCoord2f
  2. glMultiTexCoord2f
  3. glMultiTexCoord2f

In tall3dsmesh.render, but I only found code close to that in T3dsMesh.Render (sure that's just inheritance) but the part that worries me, is your code has a glTexCoord2f API call, where as the code base I have for gl3ds.pas does not have this line, i.e. the file I have has (three of):

Code:
  1. glNormal3fv
  2. glMultiTexCoord2f
  3. glMultiTexCoord2f

If you're sure everything is as it should be; I'll need directing as to what you'd like me to comment out - or just drop me a gl3ds.pas file - at the moment I think you're referring to the glNormal3fv lines in T3dsMaterial.Apply; but I could be wrong. Also, I don't have any code after if FTwoSided then in that procedure.

After all this; you might not really care that someone with an older graphics card is having problems with your stuff. I'm sure that most people will be using new graphics cards where this isn't a problem (that's where I'm thinking the problem must lie, I can't see it being anything else specific to a system). I would just like to be able to load a model and animate it, without coding it myself of course! So I do appreciate the effort you're putting in to getting this working on my system.

_________________
Cheers, DpM
http://www.hmusiccentre.org.uk


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Mai 23, 2007 21:40 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
you have to comment out glNormal3fv

remember you added glTexCoord2f in response to a previous post.

it is the if FTwoSided then that should not be able to set two sided on or off.

a TAll3dsMesh consists of at least one T3dsMesh but mostly more then one. so Tall3ds mesh calls the render for each mesh.

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Mai 23, 2007 21:52 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jan 24, 2007 00:44
Beiträge: 144
Um, I don't remember... crikey, I must be getting lost. Do you want to check it over? I get the same result with the code looking like this...

T3dsMesh.Render looks like:

Code:
  1. procedure T3dsMesh.Render;
  2. var
  3.   f: Integer;
  4.   matid: Integer;
  5.   id1, id2, id3: Integer;
  6.   v1, v2, v3: array [0..2] of single;
  7.   calcv1, calcv2, calcv3: T3dPoint;
  8.   lightv1, lightv2, lightv3: t3dpoint;
  9.   matrix: clsMatrix;
  10.   offset: Single;
  11.  
  12.   //bumpmapping strength
  13.  
  14. begin
  15.   offset := 0;
  16.   if fdisplaylist<>0 then glcalllist(fdisplaylist) else
  17.   begin
  18.     matid := 999; //hmm since material now starts with 0 this has to be higer...
  19.     glpushmatrix();
  20.     if FNumIndices > 0 then
  21.     begin
  22.       f := 0;
  23.       while f < FNumIndices - 1 do
  24.       begin
  25.           //set the id for picking
  26.         if pickmesh then
  27.           glColor3f((Fid and $FF)/255,((Fid shr <!-- s8) --><img src=\"{SMILIES_PATH}/icon_cool.gif\" alt=\"8)\" title=\"Cool\" /><!-- s8) --> and $FF)/255,((Fid shr 16)and $FF)/255);
  28.         if pickface then
  29.           glColor3f(((f div 3) and $FF)/255,(((f div 3) shr <!-- s8) --><img src=\"{SMILIES_PATH}/icon_cool.gif\" alt=\"8)\" title=\"Cool\" /><!-- s8) --> and $FF)/255,(((f div 3) shr 16)and $FF)/255);
  30.           //begin setting material
  31.           //only set material if different from previous
  32.  
  33.         if FMatId<>nil then
  34.         if FMatId[0] > -1 then //does this always evaluate to true?
  35.         begin
  36.           if FMatId[f div 3] <> matid then
  37.           begin
  38.             matid := FMatId[f div 3];
  39.             if matid > -1 then
  40.             if not ambientmode then
  41.               TAll3DSMesh(owner).material[matid].apply;
  42.           end;
  43.             //end setting material
  44.         end;
  45.  
  46.           //read vertex data for the face
  47.   (*        v1[0] := FVertex[FIndices[f]].x;
  48.           v1[1] := FVertex[FIndices[f]].y;
  49.           v1[2] := FVertex[FIndices[f]].z;
  50.  
  51.           v2[0] := FVertex[FIndices[f + 1]].x;
  52.           v2[1] := FVertex[FIndices[f + 1]].y;
  53.           v2[2] := FVertex[FIndices[f + 1]].z;
  54.  
  55.           v3[0] := FVertex[FIndices[f + 2]].x;
  56.           v3[1] := FVertex[FIndices[f + 2]].y;
  57.           v3[2] := FVertex[FIndices[f + 2]].z; *)
  58.           // the new way
  59.         v1[0] := FVertex[FFaces[f div 3].Vertex[0]].x;
  60.         v1[1] := FVertex[FFaces[f div 3].Vertex[0]].y;
  61.         v1[2] := FVertex[FFaces[f div 3].Vertex[0]].z;
  62.  
  63.         v2[0] := FVertex[FFaces[f div 3].Vertex[1]].x;
  64.         v2[1] := FVertex[FFaces[f div 3].Vertex[1]].y;
  65.         v2[2] := FVertex[FFaces[f div 3].Vertex[1]].z;
  66.  
  67.         v3[0] := FVertex[FFaces[f div 3].Vertex[2]].x;
  68.         v3[1] := FVertex[FFaces[f div 3].Vertex[2]].y;
  69.         v3[2] := FVertex[FFaces[f div 3].Vertex[2]].z;
  70.  
  71.           //     id1:=0;
  72.           //     id2:=0;
  73.           //     id3:=0;
  74.  
  75.           //if a skeleton is available then ...
  76.         if TAll3DSMesh(owner).FSkeleton<>nil then
  77.           //if there is a bone then apply bone translate etc...
  78.         if TAll3DSMesh(owner).FSkeleton[TAll3DSMesh(owner).FCurrentSkeleton].FNumBones>0 then
  79.         if FBoneId <> nil then
  80.         begin
  81.           id1 := FBoneId[FIndices[f]];
  82.           id2 := FBoneId[FIndices[f + 1]];
  83.           id3 := FBoneId[FIndices[f + 2]];
  84.  
  85.           if id1 <> -1 then
  86.           begin
  87.             matrix := TAll3DSMesh(owner).FSkeleton[TAll3DSMesh(owner).FCurrentSkeleton].FBone[id1].FMatrix;
  88.             matrix.rotateVect(v1);
  89.             matrix.translateVect(v1);
  90.           end;
  91.  
  92.           if id2 <> -1 then
  93.           begin
  94.             matrix := TAll3DSMesh(owner).FSkeleton[TAll3DSMesh(owner).FCurrentSkeleton].FBone[id2].FMatrix;
  95.             matrix.rotateVect(v2);
  96.             matrix.translateVect(v2);
  97.           end;
  98.  
  99.           if id3 <> -1 then
  100.           begin
  101.             matrix := TAll3DSMesh(owner).FSkeleton[TAll3DSMesh(owner).FCurrentSkeleton].FBone[id3].FMatrix;
  102.             matrix.rotateVect(v3);
  103.             matrix.translateVect(v3);
  104.           end;
  105.         end;
  106.  
  107.         if FMatId<>nil then
  108.         If TAll3DSMesh(owner).material[matid].FHasbumpmap then
  109.         begin
  110.             //calculate bumpmapping
  111.           Calcv1.x := V1[0];
  112.           Calcv1.y := V1[1];
  113.           Calcv1.z := V1[2];
  114.           Calcv2.x := V2[0];
  115.           Calcv2.y := V2[1];
  116.           Calcv2.z := V2[2];
  117.           Calcv3.x := V3[0];
  118.           Calcv3.y := V3[1];
  119.           Calcv3.z := V3[2];
  120.  
  121.             //think about calculating this only once...
  122.           LightV1 := VectorSubtract(ObjLightPos,CalcV1);
  123.           LightV1 := Normalize(LightV1);
  124.           LightV2 := VectorSubtract(ObjLightPos,CalcV2);
  125.           LightV2 := Normalize(LightV2);
  126.           LightV3 := VectorSubtract(ObjLightPos,CalcV3);
  127.           LightV3 := Normalize(LightV3);
  128.  
  129.           offset:=TAll3DSMesh(owner).Material[matid].FBumpmapStrength;
  130.         end
  131.         else
  132.         begin
  133.             //no bumpmapping
  134.           LightV1.x:=0;
  135.           LightV1.y:=0;
  136.           LightV1.z:=0;
  137.           LightV2.x:=0;
  138.           LightV2.y:=0;
  139.           LightV2.z:=0;
  140.           LightV3.x:=0;
  141.           LightV3.y:=0;
  142.           LightV3.z:=0;
  143.           offset:=0;
  144.         end;
  145.  
  146.  
  147.           //render the face
  148.         glbegin(GL_TRIANGLES);
  149.        // glNormal3fv(@FVnormal[FNormalIndices[f]]);
  150. //        glMultiTexCoord2f(GL_TEXTURE0,FMapping[FIndices[f]].tu, FMapping[FIndices[f]].tv);
  151. //        glMultiTexCoord2f(GL_TEXTURE1,FMapping[FIndices[f]].tu + (lightv1.x*offset), FMapping[FIndices[f]].tv + (lightv1.y*offset));
  152.         if pickvertex then
  153.           glColor3f((f and $FF)/255,((F shr <!-- s8) --><img src=\"{SMILIES_PATH}/icon_cool.gif\" alt=\"8)\" title=\"Cool\" /><!-- s8) --> and $FF)/255,((f shr 16)and $FF)/255);
  154.         glVertex3fv(@v1);
  155.  
  156.        // glNormal3fv(@FVnormal[FNormalIndices[f + 1]]);
  157. //        glMultiTexCoord2f(GL_TEXTURE0,FMapping[FIndices[f + 1]].tu, FMapping[FIndices[f + 1]].tv);
  158. //        glMultiTexCoord2f(GL_TEXTURE1,FMapping[FIndices[f + 1]].tu + (lightv2.x*offset), FMapping[FIndices[f + 1]].tv + (lightv2.y*offset));
  159.         if pickvertex then
  160.           glColor3f(((f+1) and $FF)/255,(((f+1) shr <!-- s8) --><img src=\"{SMILIES_PATH}/icon_cool.gif\" alt=\"8)\" title=\"Cool\" /><!-- s8) --> and $FF)/255,(((f+1) shr 16)and $FF)/255);
  161.         glVertex3fv(@v2);
  162.  
  163.        // glNormal3fv(@FVnormal[FNormalIndices[f + 2]]);
  164. //        glMultiTexCoord2f(GL_TEXTURE0,FMapping[FIndices[f + 2]].tu, FMapping[FIndices[f + 2]].tv);
  165. //        glMultiTexCoord2f(GL_TEXTURE1,FMapping[FIndices[f + 2]].tu + (lightv3.x*offset), FMapping[FIndices[f + 2]].tv + (lightv3.y*offset));
  166.         if pickvertex then
  167.           glColor3f(((f+2) and $FF)/255,(((f+2) shr <!-- s8) --><img src=\"{SMILIES_PATH}/icon_cool.gif\" alt=\"8)\" title=\"Cool\" /><!-- s8) --> and $FF)/255,(((f+2) shr 16)and $FF)/255);
  168.         glVertex3fv(@v3);
  169.         glend;
  170.  
  171.         f := f + 3;
  172.       end;
  173.     end;
  174.   end;
  175.   glpopmatrix();
  176. end;
  177.  

T3dsMaterial.Apply looks like:

Code:
  1. procedure T3dsMaterial.Apply;
  2. var
  3.   ambient, diffuse, specular, emissive: TGLCOLOR;
  4.   power: Single;
  5. begin
  6.  
  7.   glPopAttrib; //get back default texture state...
  8.   glPushAttrib(GL_TEXTURE_BIT); //save default texture state...
  9.  
  10.   gldisable(GL_TEXTURE_2D); //just to make sure...
  11.  
  12.   diffuse.red := FDifR;
  13.   diffuse.green := FDifG;
  14.   diffuse.blue := FDifB;
  15.   diffuse.alpha := FTransparency;
  16.  
  17.     //if no ambient color data then also set diffuse for ambient
  18.   if FIsAmbient then
  19.   begin
  20.     ambient.red := FAmbR;
  21.     ambient.green := FAmbG;
  22.     ambient.blue := FAmbB;
  23.     ambient.alpha := 1.0;
  24.   end
  25.   else
  26.   begin
  27.     ambient.red := FDifR/2;
  28.     ambient.green := FDifG/2;
  29.     ambient.blue := FDifB/2;
  30.     ambient.alpha := 1.0;
  31.   end;
  32.  
  33.   specular.red := FSpcR;
  34.   specular.green := FSpcG;
  35.   specular.blue := FSpcB;
  36.   specular.alpha := 1.0;
  37.  
  38.   with emissive do
  39.   begin
  40.     red := 0.0;
  41.     green := 0.0;
  42.     blue := 0.0;
  43.     alpha := 1.0;
  44.   end;
  45.   power := 1.0;
  46.  
  47.   glMaterialfv(GL_FRONT, gl_ambient, @ambient);
  48.   glMaterialfv(GL_FRONT, gl_diffuse, @diffuse);
  49.   glMaterialfv(GL_FRONT, gl_specular, @specular);
  50.   glMaterialfv(GL_FRONT, gl_shininess, @power);
  51.   glMaterialfv(GL_FRONT, gl_emission, @emissive);
  52.  
  53.  
  54.  
  55.   if FHastexturemap = True then
  56.   begin
  57.    // glActiveTexture(GL_TEXTURE0); //MVDH 2005 march
  58.     //glenable(GL_TEXTURE_2D);
  59.   //    glbindtexture(GL_TEXTURE_2D, FTexId);
  60.     ftexture.Bind;
  61.   end;               (*
  62.       //the following it not efficient... (maybe i should have a var containing the states)
  63.     glDisable(GL_ALPHA_TEST);
  64.     if FHasOpacMap then
  65.       begin
  66.          //log.Writeln('alpha');
  67.        glEnable(GL_ALPHA_TEST);
  68.        glActiveTexture(GL_TEXTURE1);
  69.        glenable(GL_TEXTURE_2D);
  70.        ftexture.Bind;
  71.       end;
  72.  
  73.  
  74.  
  75.     if FHasBumpMap then
  76.     begin
  77.         //TODO: only change blendfunc when needed?
  78.       If FTransParency = 1.0 then
  79.         glBlendFunc(GL_SRC_ALPHA, GL_ZERO) //only fake bumpmapping
  80.       else
  81.         glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); //fake bumpmapping with transparency
  82.  
  83.  
  84.  
  85.         // RGB
  86.       glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_COMBINE);
  87.  
  88.       glTexEnvf(GL_TEXTURE_ENV,GL_COMBINE_RGB,GL_MODULATE);
  89.       glTexEnvf(GL_TEXTURE_ENV,GL_SOURCE0_RGB,GL_TEXTURE);
  90.       glTexEnvf(GL_TEXTURE_ENV,GL_OPERAND0_RGB,GL_SRC_COLOR);
  91.       glTexEnvf(GL_TEXTURE_ENV,GL_SOURCE1_RGB,GL_PREVIOUS);
  92.       glTexEnvf(GL_TEXTURE_ENV,GL_OPERAND1_RGB,GL_SRC_COLOR);
  93.  
  94.         // alpha
  95.       glTexEnvf(GL_TEXTURE_ENV,GL_COMBINE_ALPHA,GL_REPLACE);
  96.       glTexEnvf(GL_TEXTURE_ENV,GL_SOURCE0_ALPHA,GL_TEXTURE{0});
  97.       glTexEnvf(GL_TEXTURE_ENV,GL_OPERAND0_ALPHA,GL_SRC_ALPHA);
  98.  
  99.     end;
  100.   end;
  101.  
  102.  
  103.   if FHasBumpmap = True then
  104.   begin
  105.     glActiveTexture(GL_TEXTURE1);
  106.     glenable(GL_TEXTURE_2D);
  107.       //glbindtexture(GL_TEXTURE_2D, FTexId);
  108.     ftexture.Bind;
  109.  
  110.       // RGB
  111.     glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_COMBINE);
  112.     glTexEnvf(GL_TEXTURE_ENV,GL_COMBINE_RGB,GL_REPLACE);
  113.     glTexEnvf(GL_TEXTURE_ENV,GL_SOURCE0_RGB,GL_PREVIOUS);
  114.     glTexEnvf(GL_TEXTURE_ENV,GL_OPERAND0_RGB,GL_SRC_COLOR);
  115.  
  116.       // alpha
  117.     glTexEnvf(GL_TEXTURE_ENV,GL_COMBINE_ALPHA,GL_ADD_SIGNED);
  118.     glTexEnvf(GL_TEXTURE_ENV,GL_SOURCE0_ALPHA,GL_TEXTURE);
  119.     glTexEnvf(GL_TEXTURE_ENV,GL_OPERAND0_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
  120.  
  121.     glTexEnvf(GL_TEXTURE_ENV,GL_SOURCE1_ALPHA,GL_PREVIOUS);
  122.     glTexEnvf(GL_TEXTURE_ENV,GL_OPERAND1_ALPHA,GL_SRC_ALPHA);
  123.   end;
  124.               *)
  125.   //Two Sided Materials
  126. {  if FTwoSided then
  127.     glDisable(GL_CULL_FACE)
  128.   else
  129.     glEnable(GL_CULL_FACE); }
  130.  
  131.  
  132. end;

I don't mind you just pointing out to me what it should look like and I'll try it out for you.

_________________
Cheers, DpM
http://www.hmusiccentre.org.uk


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Mai 23, 2007 22:30 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
looks pretty good this way as this should only render the mesh without textures applied and without normals also. e.g. if a normal has a wrong value it can make a mesh appear to look to bright or to dark. Do you still get the white head?

And if you want the whole character look white comment out ftexture.Bind; also.

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 33 Beiträge ]  Gehe zu Seite Vorherige  1, 2, 3  Nächste
Foren-Übersicht » English » English Programming Forum


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 5 Gäste


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.011s | 15 Queries | GZIP : On ]