Jump to content
  • Advertisement
Sign in to follow this  

OpenGL Solved: help with APPLE float color (FBO for ESM)

This topic is 3033 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am currently trying to implement EVSM.

First of all I need to do ESM but I got some problems with texture clamping. Of course I need to write values grater then 1.0f but I can't disable camping into [0,1]. I read some apple mailing lists and more people got this problem.
For example here:

Here I found that I should for some reason disable blend or try to use internal format 0x8815 but nothing seems to changed anyway.

apple extensions has OpenGL extension guide of supported ext with link to
color_buffer_float so I think It should be supported.

I tried to call void ClampColorARB(enum target, enum clamp); but It looks like OpenGL did not recognize it.

Well I forgot to send my init parameters for NSOpenGLView object so here they are:

CGDirectDisplayID display = CGMainDisplayID();

GLuint attributes[] =
NSOpenGLPFAScreenMask, (NSOpenGLPixelFormatAttribute)CGDisplayIDToOpenGLDisplayMask(display),
NSOpenGLPFAColorSize, (NSOpenGLPixelFormatAttribute)128, // THIS ONE STAY AT 128
NSOpenGLPFADepthSize, (NSOpenGLPixelFormatAttribute)24, // THIS ONE FAIL INTO 8

NSOpenGLPixelFormat *format = [[NSOpenGLPixelFormat alloc] initWithAttributes: (NSOpenGLPixelFormatAttribute*)attributes];

[self setPixelFormat:format];

I think this is specific for apple so I am asking how should I setup FBO or texture if I don't want to clamp this values.

Clamping was caused by Interface Builder bug (switched to default - use only manual setup from source code). Now I am able to store values greater than 1.0f but I've got a lot of garbage (it looks like I am not biasing but I do)

Any idea where should be problem?



Everything works fine now only problem was because my bias was performed after exponential function...
If there is anyone who got problems with floating point textures (16/32) with Apple platform, try to set up NSOpenGLView attributes (NSOpenGLPixelFormatAttribute posted here) and set default values in Interface Builder

I hope this will help someone and save some time while trying to find where should be problem

[Edited by - SaTANO on August 23, 2010 3:31:43 PM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!