Shadow mapping port to JOGL and 0x500 GL error

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Shadow mapping port to JOGL and 0x500 GL error

mezlogo
Good day, everyone!
My knowledge is very modest, but very necessary and I want to implement a shadow in JOGL, I found (in my opinion) pretty simple implementation in delphi, and just tried to port to, the fact is that when initialization error goes, wrong ENUM value when calling a method glTexParameteri and glTexGeni in startInit(GL2 gl). I can't find a solution to my problem, not well-versed in openGL and badly know English, as you can see.
P.S. thanks in Advance to all, and I apologize for my English.


http://pastebin.com/fnamve4P

(I apologize for comments on Russian)
Reply | Threaded
Open this post in threaded view
|

Re: Shadow mapping port to JOGL and 0x500 GL error

gouessej
Administrator
Hi

GL_DEPTH_TEXTURE_MODE wasn't supported in "early" versions of OpenGL. Which graphics card do you use? You should rather look at the shadow example in jogl-demos instead of porting an example from Delphi to Java. Best regards.

Edit.: You should use Buffers.newDirectFloatBuffer() instead of FloatBuffer.allocate().
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Shadow mapping port to JOGL and 0x500 GL error

mezlogo
This post was updated on .
Thanks for the reply!
My laptop is a HP, and, apparently, starts first intel hd and only then radeon 6770m.
Yes I agree with you, but I can't find a working demo for jogl 2.
If you have example, would be very grateful!
Thank you.


Added: for example, here https://jogamp.org/jogl-demos/www/ (on offical jogl demo page), we have 2 nvidia example, translate to JOGL from c++, but source avalible only on c++.
Reply | Threaded
Open this post in threaded view
|

Re: Shadow mapping port to JOGL and 0x500 GL error

gouessej
Administrator
The source code of these demos is here:
https://github.com/sgothel/jogl-demos/tree/master/src/demos
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Shadow mapping port to JOGL and 0x500 GL error

mezlogo
Thanx!
But i importing this classes almost 30 minute, and its only bigeer and biger.(Mat1-4f + RotNf + Vec1-4d + many-many extern classes)
Maybe exist some smaller, that 10-15k string code sample JOGL 2 shadow mapping?
p.s. sorry for my noobe, but i don't know how to learn it.
Reply | Threaded
Open this post in threaded view
|

Re: Shadow mapping port to JOGL and 0x500 GL error

gouessej
Administrator
Hi

jogl-demos contains tons of examples, including the ports of all examples from the OpenGL Red Book, it's very useful for beginners even though hwShadowmapsSimple and infiniteShadowVolumes are the best examples for your purpose. Don't be sorry for being a newbie but learning takes a lot of time. OpenGL isn't a trivial API, you won't learn it within a few days or weeks. We won't provide some oversimplified examples each time someone doesn't want to spend some time in downloading existing ones; therefore, I advise you to spend some time in getting them. Moreover, shadow mapping isn't the first feature that I would implement if I was a beginner.
Julien Gouesse | Personal blog | Website