Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (711)
Games in Android Showcase (213)
games submitted by our members
Games in WIP (785)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / OpenGL Development / Re: OpenGL in Java - Modern 3D Graphics Programming on: 2012-11-04 21:54:25
Sorry if i resume this topic, but i want to inform future readers that all tutorials have been ported and -most of all- they all work Cheesy
2  Java Game APIs & Engines / OpenGL Development / sRGB framebuffers on: 2012-06-11 15:26:24
Hi guys, i'm back with another srgb question.

correct / wrong:

I want the screen image to be in the sRGB colorspace. In FreeGLUT i have to include the GLUT_SRGB flag, in LWJGL i was told to create this Display:

Display.create(new PixelFormat().withSRGB(true));

but i don't notice changes.
glEnable/glDisable GL_FRAMEBUFFER_SRGB makes the image brighter/darker, but no as brighter as the correct image i posted before.

I don't post code here, it's too long: i'm asking you suggestions and hypotesis on what could be wrong. Thanks in advance
3  Java Game APIs & Engines / OpenGL Development / Re: sRGB textures on: 2012-03-04 22:21:34
@princec, Roquen
I've googled for some time before posting here, and i haven't found many resources on this thanks for the link Smiley

@Spasi i downloaded the nVidia texture tool and check the textures, and it says they have mipmaps. So i re-debugged the dds loader, and found the error Smiley i was confused because of gimp didn't show mipmaps to me, so i though it was some sort of sRGB problem. Now the mipmaps are correct, and they are loaded from the texture data, as you told to me. Thank you for your time and your explanations, now i understand both mipmaps and sRGB Smiley
4  Java Game APIs & Engines / OpenGL Development / Re: sRGB textures on: 2012-03-04 00:07:47
Yes, that is the source Smiley
I thought the fault could be my dds loader (which is itself a part of the port of the same project), but i have debugged together the java and c++ code, and all the variables i could check had the same values...and the textures are working for previous tuts (but always with glGenerateMipmaps()), so i have no more ideas, and decided to ask for help here. I´ll be waiting for your reply on the .dds file Smiley
5  Java Game APIs & Engines / OpenGL Development / Re: sRGB textures on: 2012-03-03 22:58:23
@Riven thank you for the code, i'll try it Smiley

@Spasi, thanks again for your attention, and for the links i will read tomorrow Smiley. Your words lead me to another questions:

I have used the same resources (.dds) that the original author uses in his project, and the compiled c++ runs perfectly on my pc so it's not an hardware why i had to add glGenerateMipmaps() to get the texture displayed? Are there some differences between c++ OpenGL and LWJGL?

And also, i opened the dds with gimp + plugin, i see only the texture, not texture + mipmaps (like the image on "Gamma and Mipmapping" post you write to me) so i think the mipmap are generated on the go, am i right? How are they generated without glGenerateMipmaps()?

These two points are not clear to me  Huh

Last thing i want to highlight, the tutorial divides the 'textures srgb' part from the 'gamma correction' part:
-the 'G' key switches between a lRGB checkerboard and the sRGB one (which is 'brighter', but not in my lwjgl application - my problem);
-the 'A' key switches between the 'no gamma' shader (which does nothing) and the 'gamma' shader, which perform this correction:
void main()
   vec4 gamma = vec4(1.0 / 2.2);
   gamma.w = 1.0;
   outputColor = pow(texture(colorTexture, colorCoord), gamma);

(which makes the textures even brighter - and it works perfectly)
6  Java Game APIs & Engines / OpenGL Development / Re: sRGB textures on: 2012-03-03 17:58:59
Thanks for the responses.
I'm new at programming OpenGL, and this is my first code on mipmaps, srgb and so on...sorry if i'll say something wrong.

@Danny02, Spasi
In the original tutorial (which is written in c++) there isn't glGenerateMipmap(), i had to add it otherwise the textures would be black.
Perhaps this is the problem..? How can i check if mipmaps were generated with other tools? Are they stored in the texture data?

@theagentd, sproingie
The problem isn't getting gray, but getting a 'darker' gray then the expected one. And yes, with anisotropic filter the texture 'propagates' correctly, but this is not my problem Smiley
For srgb texture see the link i write in the first post, basically is a texture with color differents from 'normal' RGB

7  Java Game APIs & Engines / OpenGL Development / sRGB textures on: 2012-03-03 13:47:19
Hi, i'm having some troubles with sRGB textures. Here's my code to create the texture:
g_gammaTexture = glGenTextures();
glBindTexture(GL_TEXTURE_2D, g_gammaTexture);

for (int mipmapLevel = 0; mipmapLevel < pImageSet.getMipmapCount(); mipmapLevel++) {
   SingleImage image = pImageSet.getImage(mipmapLevel, 0, 0);
   Dimensions dims = image.getDimensions();

   glTexImage2D(GL_TEXTURE_2D, mipmapLevel, GL_SRGB8, dims.width, dims.height, 0,
      GL12.GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, image.getImageData());

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, pImageSet.getMipmapCount() - 1);

glBindTexture(GL_TEXTURE_2D, 0);

If you want to see the rest of the code:

This is the tutorial i am rewriting using LWJGL, i suggest to quickly read it to understand my problem.
Now i'm asking you any advice you can give me for using i generating mipmaps in the correct way?
I think the problem is i am not loading the texture correctly...could the error be caused by a wrong bytebuffer(image.getImageData())?
I've checked it a lot of times and it seems correct to me...

To summarize, here is what i get:

and here is what the texture should be:

Any help is greatly appreciated.
8  Java Game APIs & Engines / OpenGL Development / Re: MappedObject on: 2012-02-03 22:08:34
Thank you guys, i understand now.
I played a bit with these classes, and i realized that they make code too difficult to read for the project I'm doing, so i won't use them.
But thanks again for the help Smiley
9  Java Game APIs & Engines / OpenGL Development / Re: MappedObject on: 2012-02-03 14:42:15
Thanks for the reply.
I saw that thread but the links in the first post are broken and the example class MappedVec3 doesn't compile for me so i thought it is an old thread.
The compilation fails because "the attribute sizeof is undefined for the annotation type MappedType".
I referenced to the build path lwjgl_util.jar. Am i missing something?
10  Java Game APIs & Engines / OpenGL Development / MappedObject on: 2012-02-02 22:35:50
Hi, i'm trying to understand how this class works. I think this is what i need to convert in a standard way c++ structs; i searched a bit but i didn't find any resources :\ I want to use this class properly from the start, so can someone help me? Maybe with a simple example?  Grin
Thanks in advance,

11  Java Game APIs & Engines / OpenGL Development / Re: OpenGL in Java - Modern 3D Graphics Programming on: 2012-01-20 10:57:25
+1 medal for putting it on github.  You planning on porting the book copy to the project wiki on github if the author's ok with it?

Hi, thank you for the medal Smiley
And thank you for this suggestion, i will keep in mind. For now, we want to complete all the tutorials as a fast as possibile Smiley
Check out the project repository, we added the wonderful tutorial 7 and soon we'll complete the II part of the book!
12  Java Game APIs & Engines / OpenGL Development / Re: OpenGL in Java - Modern 3D Graphics Programming on: 2012-01-17 14:43:35
Thank you all for the unexpected amazing feedback!  Cheesy
13  Java Game APIs & Engines / OpenGL Development / Re: OpenGL Development - Resources on: 2012-01-16 20:49:12
14  Java Game APIs & Engines / OpenGL Development / OpenGL in Java - Modern 3D Graphics Programming on: 2012-01-16 20:01:52
Hi all!
I've started the Java porting of these tutorials:
This is a recent book entirely written using OpenGL version 3.3.
We have ported the first 6 chapter by now, but when we get time we will do the remaining.
Here's the source code:


PS. Sorry if my english sucks  Grin

EDIT : sorry the link was broken now it is fixed
Pages: [1]
numerical (156 views)
2017-02-21 07:32:16

numerical (156 views)
2017-02-21 07:31:46

theagentd (263 views)
2017-02-18 13:42:33

theagentd (265 views)
2017-02-18 13:35:16

h.pernpeintner (1433 views)
2017-01-24 22:39:11

h.pernpeintner (1417 views)
2017-01-24 22:38:32

Galdo (1980 views)
2017-01-12 13:44:09

Archive (2036 views)
2017-01-02 05:31:41

0AndrewShepherd0 (2573 views)
2016-12-16 03:58:39

0AndrewShepherd0 (2329 views)
2016-12-15 21:50:57
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 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‑
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!