Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Need Sample Code - $50 USD Reward  (Read 3330 times)
0 Members and 1 Guest are viewing this topic.
Offline sunsett

Senior Member




ribbit!


« Posted 2009-07-18 00:10:48 »

Okay, so I'm learning JOGL and it's going pretty well for the most part, but I've spent WAY too much time stuck on this one issue and rather than continuing to get more frustrated not being able to figure it out I thought I would offer a reward for what I'm asking for presuming that it is concise and well documented code that serves my purpose.

What I'm asking for:
  • Simple re-usable Object that represents a Texture
  • Uses PBOs if available
  • Uses VBOs if available or falls back to vertex arrays
  • Works similarly to TextureRenderer except only two explicit image types need to be supported (one with alpha and one without)
  • Should provide an "update" method to replace or originally set the texture.
  • "update" method should allow new dimensions to be assigned and the texture should change accordingly
  • "draw" method should be provided for rendering of texture to screen
  • Should work properly with fixed-function or GLSL pipeline
  • Should use SubImage
  • Does not need to maintain any extra stuff or reset anything like TextureRenderer does when drawing, positioning, coloring, etc. should be managed outside of this.
  • Needs to take in a BufferedImage as an "update" argument with an x, y, width, and height so as to only take a portion of the BufferedImage rather than a whole BufferedImage
  • Must not keep a reference to the BufferedImage except in the "update" method when replacing the texture as the BufferedImage will be reused.
  • Must have complete mipmapping support to appear as clean and concise as TextureRenderer does
  • Must be documented and understandable
  • Must be self-contained. No references to any JOGL-specific (TextureRenderer, TextureData, etc.) Objects or 3rd party APIs.

This list is derived by what I understand (as a noob with OpenGL) as best-practices and if someone provides a valid implementation of my needs yet has good reason for breaking some of these requests I will readily consider it if explained.

I know $50 isn't really much to offer, but this is not a purchase of code, you are free to use the code yourself or release it to the community.  Also, I will make a post as soon as someone submits valid code fulfilling all the requirements and will only pick one person so you do run the risk of writing some code and not being chosen. Shocked

Please feel free to drop me a message if you have any questions.  Feel free to post your code directly here or PM it to me and once a submission fulfills the requirements I will work out payment.
Offline indexunknown

Junior Member





« Reply #1 - Posted 2009-07-18 08:15:38 »

Asking an OpenGL expert to work full time for like a month for 50$ ?
Offline emzic

Senior Member





« Reply #2 - Posted 2009-07-18 11:16:52 »

sounds like a interesting task. so why not?

but:
  • Uses VBOs if available or falls back to vertex arrays

how can a texture make use of vertex buffer objects or vertex arrays?

www.embege.com - personal website
webstart blendinspect - OpenGL BlendingModes visualization.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 783
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #3 - Posted 2009-07-18 11:38:41 »

I bet he confused VBOs with FBOs, and then knew VAs had something to do with VBOs.

Either that, or he knows TextRenderer uses either VBOs or VAs, and he thinks he needs one of those in a Texture class.

Further, we all know that this is a work-related project for you, and $50 for such a beast, which you get paid for, and can exploit commercially, is... laughable. I mean... expecting mipmapping to work out of the box in combination with SubImage AND resizing the texture (which means NPOT)? That is quite a bit of work, even if you're going the do it the bruteforce (slow) way.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline sunsett

Senior Member




ribbit!


« Reply #4 - Posted 2009-07-18 13:47:06 »

Asking an OpenGL expert to work full time for like a month for 50$ ?

Really? I've gotten everything working with a couple hundred lines of code and I'm an amateur. Of course I'm not using PBO (which I didn't think would be that complicated if I just understood how to switch) and the mipmapping just doesn't look right and I haven't been able to figure out if it has to do with the NPOT or something else.

sounds like a interesting task. so why not?

but:
how can a texture make use of vertex buffer objects or vertex arrays?

Just like TextureRenderer actually has a draw method to actually render the texture to the screen on a quad in immediate mode I want to have the same functionality, but using VBOs or vertex arrays for the quad.

I bet he confused VBOs with FBOs, and then knew VAs had something to do with VBOs.

Either that, or he knows TextRenderer uses either VBOs or VAs, and he thinks he needs one of those in a Texture class.

Further, we all know that this is a work-related project for you, and $50 for such a beast, which you get paid for, and can exploit commercially, is... laughable. I mean... expecting mipmapping to work out of the box in combination with SubImage AND resizing the texture (which means NPOT)? That is quite a bit of work, even if you're going the do it the bruteforce (slow) way.

Not commercially, but in an open-source project.  I do obviously gain by this or I wouldn't be offering money to get it done, but the goal for me is primarily that of learning.  I'm not trying to force anyone to do anything.  If it's not worth $50 to do it then don't, but I just assumed many of you have probably already written all of this functionality before and would be a simple matter of copying and pasting and cleaning up to provide it.
Offline sunsett

Senior Member




ribbit!


« Reply #5 - Posted 2009-07-18 13:53:22 »

Here are links to the code I've already written that doesn't quite work and still needs a lot of cleanup before it's very useful:

http://jseamless.googlecode.com/svn/framework/branches/2.0/src/java/org/jseamless/gl/Shape.java
http://jseamless.googlecode.com/svn/framework/branches/2.0/src/java/org/jseamless/gl/GLTexture.java
http://jseamless.googlecode.com/svn/framework/branches/2.0/src/java/org/jseamless/gl/ShaderUtility.java
http://jseamless.googlecode.com/svn/framework/branches/2.0/src/java/org/jseamless/gl/TextureUtility.java
http://jseamless.googlecode.com/svn/framework/branches/2.0/src/java/org/jseamless/gl/VertexUtility.java

You are welcome to base code on this if it helps, I just assumed since I'm still a noob you guys would write much more efficient and effective code than I would, so I was leaving it open to you.  Like I said, the main problems I have with that code is the it doesn't use PBOs and the mipmapping just doesn't look quite right and it very well may be NPOT issues, but I don't know and have been stuck on it for so long it brought me to ask for help.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 783
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #6 - Posted 2009-07-18 14:04:51 »

Just to provide you with some trivial information:

You really do not want either VBO or VA related code in your Texture class.
It limits you to 1 quad per render call anyway, which is probably even fastest in immediate mode.

Just keep your geometry (quads, triangles) out of your Texture class, seriously.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline gouessej
« Reply #7 - Posted 2009-07-19 18:33:44 »

Just to provide you with some trivial information:

You really do not want either VBO or VA related code in your Texture class.
It limits you to 1 quad per render call anyway, which is probably even fastest in immediate mode.

Just keep your geometry (quads, triangles) out of your Texture class, seriously.
I agree with Riven. sunsett, you won't see any improvement by using VBO to draw a single quad. The use of vertex arrays and VBO becomes interesting when you have at least tens of triangles.

Offline sunsett

Senior Member




ribbit!


« Reply #8 - Posted 2009-07-19 19:43:42 »

Ah, good to know.  I guess the only critical item for me is to resolve my appearance issues with mipmapping...if I enable auto-mipmapping the content from a distance looks faded whereas with TextureRenderer it looks perfectly crisp.  Since it doesn't seem anyone is interested in taking me up on my offer is there a good tutorial on properly handling NPOT + mipmapping?
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 783
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #9 - Posted 2009-07-19 20:07:04 »

It has to do with gamma correction.

http://stackoverflow.com/questions/831893/does-it-make-sense-to-use-own-mipmap-creation-algorithm-for-opengl-textures

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline sunsett

Senior Member




ribbit!


« Reply #10 - Posted 2009-07-19 20:41:40 »

That makes sense, but I don't understand how to actually apply that....
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 783
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #11 - Posted 2009-07-19 21:13:27 »

Sample code is provided in that link...

So, just to spoonfeed: the parameters a,b,c,d are 4 values of 1 channel of the 4 pixels, like: R, G or B. So you simply get your typical 2x2 block of pixels, grab the R,G,B values, normalize to 0..1, pass each set of each channel into that function, and you end up with 1 value per channel, multiply by 255 you got your resulting pixel. Don't expect it so be fast, at 3 or 4 sqrt() per pixel, but well, it will get rid of your 'shade' in sharp contrast textures.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline tberthel
« Reply #12 - Posted 2010-07-02 13:55:07 »

I think Riven should get the 50.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (12 views)
2014-08-28 18:26:30

CopyableCougar4 (24 views)
2014-08-22 19:31:30

atombrot (37 views)
2014-08-19 09:29:53

Tekkerue (30 views)
2014-08-16 06:45:27

Tekkerue (29 views)
2014-08-16 06:22:17

Tekkerue (18 views)
2014-08-16 06:20:21

Tekkerue (27 views)
2014-08-16 06:12:11

Rayexar (65 views)
2014-08-11 02:49:23

BurntPizza (41 views)
2014-08-09 21:09:32

BurntPizza (33 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!