Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pbuffer/GLUT/Cg



If you are drawing using programmability into a pbuffer context you must enable and disable state for that context as you would any other. SInce the programs draw into the pbuffer context you will obviously need the proper state set in that context. The context you are texturing to has nothing to do with this and will just have to have the proper state for texturing.

In the end a pbuffer is just a drawable and it's context is just a context. The only place that there is any difference is the texturing where you have to use the specific texturing call that know how to texture from a pbuffer's drawable.

Of the two operations that are occurring it would be helpful to know which fails. To do this draw to the pbuffer with your program, use something like read pixels to copy this to a buffer/image than you can verify (obviously ensure this copy code works with a standard window). If this work than test the texturing of any content with from the pbuffer. Once this works ensure combine the two and ensure you are not mixing your state settings and you absolutely know which context is current for any given OpenGL call.

Don't know, maybe this will help.

BTW, the simple answer to your question, is yes but it is no different that any other context using programs (thus there is no different documentation, the same parts of the OpenGL spec apply). The same proper state must be set, which may include the shader (as these are OpenGL calls which go only to the current context).

On Nov 16, 2004, at 6:21 AM, Gordon Erlebacher wrote:



I have some more information that might solve my problem (with your help if I am lucky):

I am using Glut.
I have created a pbuffer.
I can write to the pbuffer and from the pbuffer to the screen using the fixed pipeline.


I can also write to the screen using a pixel shader (ARB)
However, I cannot write to the pbuffer using the shader. For example, the following code, that
writes to the pbuffer, clears the pbuffer screen and fills it with red (which eventually appears on the screen).
However, the shader, which changes the color from red to yellow, has no effect. Yet, when I simply change
the current context from pbuffer to screen, the shader works as it should and the background red color is
overwritten.


This suggests to me that somehow, the pbuffer context must be active when certain aspects of the shader
are defined, although I have not seen this documented anywhere. Any thoughts on the matter? Thanks.



_______________________________________________ Do not post admin requests to the list. They will be ignored. Mac-opengl mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden
References: 
 >pbuffer/GLUT/Cg (From: Gordon Erlebacher <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.