   Help OpenGL - OBJ loading - lighting issue
[font="Consolas"]I am new to lighting/ shading and OBJ file format thus I have to many varible to figure this one out[/font][font="Consolas"]    //setup lighting and etc... Vector4 Lightpos = new Vector4(0, 0, 0, 1f);  //x y z and focal length or something like that Vector4 WhiteLighta = new Vector4(bright, bright, bright, 1);   // Red  Green Blue  Vector4 WhiteLightd = new Vector4(bright, bright, bright, 1);   // Red  Green Blue  Vector4 WhiteLights = new Vector4(bright, bright, bright, 1);   // Red  Green Blue  GL.Light(LightName.Light0, LightParameter.Position, Lightpos); GL.Light(LightName.Light0, LightParameter.Ambient, WhiteLighta); GL.Light(LightName.Light0, LightParameter.Diffuse, WhiteLightd); GL.Light(LightName.Light0, LightParameter.Specular, WhiteLights); GL.Enable(EnableCap.Lighting); GL.Enable(EnableCap.Light0); GL.Enable(EnableCap.DepthTest); GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);   //sent blending to transparcy enabled GL.TexEnv(TextureEnvTarget.TextureEnv, TextureEnvParameter.TextureEnvMode, (int)TextureEnvMode.Combine);  //Now when I begin primitives I use Set the material colors to what I got from the MTL fileGL.Color4(colord);  (not that I had to say tr=tr*300; to get the glass to appear on the screenGL.Enable(blending)GL.Enable(texture2d);GL.Enable(EnableCap.ColorMaterial);    //this line let me get translucent looking glassGL.Material(MaterialFace.Front, MaterialParameter.Ambient, Colora); //note this is wrong value here bnut it is only one that worksGL.Material(MaterialFace.Front, MaterialParameter.Diffuse, Colord); // hmmmGL.Material(MaterialFace.Front, MaterialParameter.Specular, Colors);GL.Material(MaterialFace.Front, MaterialParameter.Shininess, ns);GL.ColorMaterial(MaterialFace.Front, ColorMaterialParameter.AmbientAndDiffuse);    // little or no effect?? GL.Begin ...........  Obj Material datanewmtl _fisk1_fisk3584_jpg   Ka 0.000000 0.000000 0.000000   Kd   1.0000   1.0000   1.0000   Tr 1.0   Ks 0.000000 0.000000 0.000000   Ns   3.2000   mapKd fisk3584.jpgnewmtl _Translucent_Glass_Tinted_Translucent_Glass_Tinted_jpg   Ka 0.000000 0.000000 0.000000   Kd   1.0000   1.0000   1.0000   Tr 0.00188235294117647   Ks 0.000000 0.000000 0.000000   Ns   3.2000   mapKd Translucent_Glass_Tinted.jpgIn areas where the glass is I get 100% Black  (effeftivly)  If I multiply the Tr value by 300 I get roughly the color I expected. and the sceene is very very darkI changed the material abient to use the kD values and the sceene is lit about right, but I still have a black where the tinted glass material is.So any Ideas what I am doing wrong?FYIW I am using OpenTK.  MY model is exported from google sketchup with a OBJ exporter.  I know there are shapes behind the glass cause once I move my paosition throught the glass they become visible.Thanks in advanceHighflierPS. by messing around I did get the Glass to look translucent bit the weird thing is I still could not see objects that were behind it.The capture image shows a texture mapped cube behind the glass that is not visible, However if you look close you will see to fish shadows that are behind the glass but a Solid Color non textured.[/font][font="Consolas"][font="Consolas"] [/font][/font]
  When using transparent objects - you need to render the objects starting with the further away from the camera and moving forward.   ;  It's supposed to be translucient.  And really?  Cause I have all sorts of other objects that seem to work ok.  It is just the models that have materials that I am having trouble with.Highflier   ;  I tried to draw the cube fist and it had no impact at all.  Plus half of the image that is missing is in the middle of the 1 shape.  So you trying to say I have to sort and render every vertex in a specific order... thats seems crazzy for a complex objectI am almost wondering if I should use the material colors in the light field and put the light colors into the material frield.......In ortho mode when I render flat 2d ish objects I sort them since the appear on the same z axis.  This way I control what is in front of what.......  That only seems to havea impact if objects are on the same z plane.Confused and frustrated......Highflier   