MayaAPI question...

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  07 July 2005
MayaAPI question...

Is there a command you can use in MayaAPI to write to the framebuffer? I'm trying to write scenedata to a framebuffer so I can retireve it later during the draw cycle....

Tried using OpenGL command glDrawBuffer(GLenum mode), but my compiler dosen't seem to recognize it....*leafing through header files*
  08 August 2005
Originally Posted by KungFu Hampster: Tried using OpenGL command glDrawBuffer(GLenum mode), but my compiler dosen't seem to recognize it....*leafing through header files*

well, it's a new feature in the Maya7.0 API (testing the beta at the moment). Shame it doesn't work though (hopefully thats just a beta problem). I'd suggest waiting for 7 to come out because there is lots of new HW shading stuff in there which should sort out a lot of in-evitable hacking.

The other question is do you really need to write the data to the frame buffer? could you use a texture or p-buffer instead?
  08 August 2005
Actually, I'm trying to create my own framebuffer and then write to it...kinda like in the nvidia demo "simple_framebuffer_object". I'm trying to use openGL calls in my class, but it's kinda weird...I have the calls to create my framebuffer looking like this....

   ////initialize framebuffers here... 
 	glGenFramebuffersEXT(1, &fb); 		 		//generate 1 framebuffer
 	glGenTextures(1, &tex); 		 		 	//generate a texture
 	glGenRenderbuffersEXT(1, &depth_rb);		 	//make a renderbuffer for the framebuffer
 //more junk after here that dosen't matter if the above dosen't run!

It compiles fine...but when I try it in Maya, all I get back is a small error message. I'm thinking it's a header file, but I'm kinda in the dark here...:(
  08 August 2005
How are you getting the function pointers to those functions?

Maya's M3dView.h includes GL/gl.h itself, so maybe your include path ordering is picking up the wrong header version.

You could try compiling something that will print out the opengl version and see if that looks funky. If you get less than 2.0.0 then something's gone awry.

You can have your characters photoreal, fast or cheap. Pick two.
  08 August 2005
are you doing this on linux?
  08 August 2005
Originally Posted by Robert Bateman: are you doing this on linux?

Unfortunetly no. I wish I was. I heard errors like this are easier to troubleshoot on Linux.

I'll try including M3dView as a header file...but I think glGenFramebuffers is located in Glut.h. I know the program will spit out openGL, cause I drew a couple polys to the scene just to check to see if that was the problem.

I have some time today, so I'm going to strip it down and put in the minimum libraries and headers...see if I can isolate the problem.

BTW, Rob...thanks for those pages on MayaAPI...I haven't looked through all the examples yet but they've been very helpful.

Thanks for your suggestions. I'll keep u posted.
  08 August 2005
Hmmm...stripped everthing out and now I seem to be getting a repeat error...about an unresolved external symbol..

I seem to be getting these a there a good way to troubleshoot when you have an error in MayaAPI like this? Or any of the weird erros that come up, such as the one I had before....

Here's another good one...soemtimes I'll end up getting NULL as an undeclared is that crap?

PS - Rob...I hoe that avatar ur using isn't's kinda freaky looking....

Last edited by GrahamHRoss : 08 August 2005 at 11:25 PM.
  08 August 2005
if it's a new openGL extension you may get errors - remember to use wglGetProcAddress to initialise all extension functions (or just use a lib like glew to do it all for you).

No the avatar isn't me, it's the drummer from lightning bolt - the photo is from the a gig they did in the electric ballroom in london (though i was there)
  08 August 2005
Oh, that makes sense. Maya only supports openGL 1.1, right? I'll look into it. Thanks!
  08 August 2005
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 01:06 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.