0

Whenever I used FTExtrudeFont and add depth to it, whenever light is added and the angle is changed as seen below (the sides goes over the side thats supposed to be covering it).

Screenshot

I simply added depth to this using the FTExtrudeFont and rendered it. I also changed the way it is being rendered

font.Render([textValue UTF8String],-1,FTPoint(),FTPoint(),0x0002);
font.Render([textValue UTF8String],-1,FTPoint(),FTPoint(),0x0004);
font.Render([textValue UTF8String],-1,FTPoint(),FTPoint(),0x0001);

since the render_all provides a worse overlap.

Andon M. Coleman
  • 42,359
  • 2
  • 81
  • 106
ardowz
  • 47
  • 8
  • Do you actually have a pixel format with a depth buffer and have you enabled depth testing (this is disabled by default)? Some more details about your OpenGL setup would be very helpful. – Andon M. Coleman Oct 11 '13 at 23:03
  • @AndonM.Coleman What do you mean by having a pixel format with depth buffer? I'm using the ftgl as basic as I can so I don't know how the pixel format and depth buffer is being set. The enable opengl stuff by the time the text is being rendered are: GL_SMOOTH, GL_COLOR_MATERIAL, GL_CULL_FACE, GL_LINE_SMOOTH , GL_DEPTH_TEST and GL_BLEND – ardowz Oct 14 '13 at 15:25
  • I mean, when you setup your render context using whatever other framework, did you setup the depth buffer? Depth buffers are an optional feature; if you enable `GL_DEPTH_TEST` in a render context that does not have a depth buffer as part of its pixel format, it has no affect. – Andon M. Coleman Oct 14 '13 at 16:42
  • @AndonM.Coleman No I did not set up any depth buffer since I couldn't find it in FTGL's demo file which I am basing my codes from. So the depth test is just enabled but no value is being set anywhere as far as I can tell. – ardowz Oct 14 '13 at 17:51
  • You need a depth buffer for this to work. The process of selecting a pixel format for render context setup is extremely platform/framework dependent, so I could not tell you the exact process for doing this. If you could point me to the code you are using I might be able to suggest a better course of action. – Andon M. Coleman Oct 14 '13 at 17:53
  • @AndonM.Coleman The way FTGL has it is just: `code` FTExtrudeFont font("/Library/Fonts/HelveticaCY.dfont"); glColor4f(1.0, 1.0, 1.0, 1.0); font.Depth(20); font.FaceSize(72); font.Render([textValue UTF8String],-1,FTPoint(),FTPoint(),0x0002); font.Render([textValue UTF8String],-1,FTPoint(),FTPoint(),0x0004); font.Render([textValue UTF8String],-1,FTPoint(),FTPoint(),0x0001); `code` – ardowz Oct 14 '13 at 18:15
  • @AndonM.Coleman is there a way to assign depth bits for opengl? I'm using FxPlug and when I output the value of `code`GL_DEPTH_BITS`code` I would get 0, but the FxRenderInfo contains 2 bits, which I can change the value easily. Although I'm not exactly sure how different it behaves when I changed the value to something higher. – ardowz Oct 15 '13 at 18:51
  • Unfortunately I am not familiar with your software, you will have to read the API documentation. But having no depth buffer is definitely your problem, this is usually something you setup when you create a render window. – Andon M. Coleman Oct 15 '13 at 18:55
  • @AndonM.Coleman Is there a generic way openGL initializes the depth buffer? I noticed that with gluInit, gl_depth_bits is already at 24. Is there a way to like manually set it? – ardowz Oct 15 '13 at 22:14
  • No, because glutInit is not part of OpenGL. Like I said, you have to look into the framework you are using. OpenGL does not have any part of its API related to setting up the render context, there are other APIs for that. – Andon M. Coleman Oct 15 '13 at 22:19

0 Answers0