Render-To-Texture?
I'm looking at the Render-To-Texture example located at http://www.pol-online.net/download.php?f...In_Texture and it doesn't appear to work on MacOS X.2.6 (or nVidia geForce cards). Can anybody point out why?
Seems to work fine for me.
450Mhz B&W G3/Rage128 16MB/X.2.6
What seems to be the problem on your mac?
450Mhz B&W G3/Rage128 16MB/X.2.6
What seems to be the problem on your mac?
---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
I just get a white square on a black background on a GeForce4Ti.
I can't see anything wrong with the code, but it's clearly not working!
I can't see anything wrong with the code, but it's clearly not working!
Yes I have a geForce as well, and all I see is a black background with a white square. It seems, from the code, the square is supposed to change color randomly. Hmm.
Try this:
change the pixelformat attributes to the following:
[sourcecode]NSOpenGLPixelFormatAttribute attributes[] = {
NSOpenGLPFADoubleBuffer,
NSOpenGLPFAAccelerated,
0 };
NSOpenGLPixelFormatAttribute attributes2[] = {
NSOpenGLPFADoubleBuffer,
NSOpenGLPFAAccelerated,
0 };[/sourcecode]
This may fix pixelformat incompatability problems.
change the pixelformat attributes to the following:
[sourcecode]NSOpenGLPixelFormatAttribute attributes[] = {
NSOpenGLPFADoubleBuffer,
NSOpenGLPFAAccelerated,
0 };
NSOpenGLPixelFormatAttribute attributes2[] = {
NSOpenGLPFADoubleBuffer,
NSOpenGLPFAAccelerated,
0 };[/sourcecode]
This may fix pixelformat incompatability problems.
---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Doesn't help (and it doesn't say invalid drawable in the console, which is what usually happens under those circumstances).
oh, the code is written wrong. I didn't look at it indepth because when I first ran it it made some color changing squares. Actually the pattern looks like invalid pointer access. Whoever wrote the demo is trying to make a texture from an offscreen context. This is fine and all, but 1)the texture is never updated and 2)he's trying to update it by changing it's context.
from this point on, your results vary depending on what kind of memory GL is trying to read from. in my case GL was trying to get some of the actual context, so I saw some pretty garbage in the intervening space. (I thought this was intended but it is not.)
on your geforce's you're probably getting blank texture memory. I doubt this demo has any real value at all.
Code:
//this line is the dead give away:
[mainContext createTexture:GL_TEXTURE_2D fromView:[offscreenWindow contentView] internalFormat:GL_RGBA];from this point on, your results vary depending on what kind of memory GL is trying to read from. in my case GL was trying to get some of the actual context, so I saw some pretty garbage in the intervening space. (I thought this was intended but it is not.)
on your geforce's you're probably getting blank texture memory. I doubt this demo has any real value at all.
---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Lugaru has neat render-to-texture 
For some reason some systems don't like it though :/

For some reason some systems don't like it though :/
Ok so obviously the previous example isn't going to work for me. So I tried Lesson #36 on NeHe (Radial Blur) which appears to have render-to-texture functionality. However, it STILL doesn't work. All I see is a plain twirly model spinning around, no blur...again this is on a geForce. Any ideas?
I figured it out. Changing GL_LUMINANCE to GL_RGBA in the glTexImage2D function seems to fix it. It looks pretty cool. I guess I'll stick to this method. Thanks everyone.
Quote:Originally posted by kelvin
Whoever wrote the demo is trying to make a texture from an offscreen context. This is fine and all, but 1)the texture is never updated and 2)he's trying to update it by changing it's context.
Code:
//this line is the dead give away:
[mainContext createTexture:GL_TEXTURE_2D fromView:[offscreenWindow contentView] internalFormat:GL_RGBA];
I don't understand. What's wrong with this?
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Render video (e.g. QuickTime) to buffer or texture? | Ingemar | 14 | 11,032 |
Jun 8, 2011 04:09 PM Last Post: mdejong1024 |
|
| Render to Texture? | IBethune | 5 | 5,229 |
May 2, 2007 04:25 AM Last Post: IBethune |
|
| PBuffer & Render to Texture (read & write) | habicht | 4 | 3,428 |
Feb 7, 2005 05:33 PM Last Post: habicht |
|
| Render to texture and Blending | reubert | 3 | 3,494 |
Oct 30, 2004 04:48 AM Last Post: arekkusu |
|

