Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (581)
games submitted by our members
Games in WIP (500)
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 22: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 17: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:

1  
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 23:21:34
@princec, Roquen
I've googled for some time before posting here, and i haven't found many resources on this topic...so 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 01: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 23: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 problem...so 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:
1  
2  
3  
4  
5  
6  
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 18: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 14:47:19
Hi, i'm having some troubles with sRGB textures. Here's my code to create the texture:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
...
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_BASE_LEVEL, 0);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, pImageSet.getMipmapCount() - 1);
glGenerateMipmap(GL_TEXTURE_2D);

glBindTexture(GL_TEXTURE_2D, 0);

If you want to see the rest of the code: https://github.com/rosickteam/OpenGL/blob/master/rosick/mckesson/IV/tut16/GammaCheckers02.java

This http://www.arcsynthesis.org/gltut/Texturing/Tut16%20Mipmaps%20and%20Linearity.html 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 sRGB...am 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 23: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
 
Francesco
 
9  Java Game APIs & Engines / OpenGL Development / Re: MappedObject on: 2012-02-03 15: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 23:35:50
Hi, i'm trying to understand how this http://lwjgl.org/javadoc/org/lwjgl/util/mapped/MappedObject.html 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,

Francesco
11  Java Game APIs & Engines / OpenGL Development / Re: OpenGL in Java - Modern 3D Graphics Programming on: 2012-01-20 11: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 15: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 21:49:12
http://openglbook.com/
14  Java Game APIs & Engines / OpenGL Development / OpenGL in Java - Modern 3D Graphics Programming on: 2012-01-16 21:01:52
Hi all!
I've started the Java porting of these tutorials: http://www.arcsynthesis.org/gltut/index.html
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: https://github.com/integeruser/gltut-lwjgl

Francesco



PS. Sorry if my english sucks  Grin

EDIT : sorry the link was broken now it is fixed
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (54 views)
2014-04-15 18:08:23

BurntPizza (53 views)
2014-04-15 03:46:01

UprightPath (66 views)
2014-04-14 17:39:50

UprightPath (49 views)
2014-04-14 17:35:47

Porlus (66 views)
2014-04-14 15:48:38

tom_mai78101 (90 views)
2014-04-10 04:04:31

BurntPizza (151 views)
2014-04-08 23:06:04

tom_mai78101 (246 views)
2014-04-05 13:34:39

trollwarrior1 (204 views)
2014-04-04 12:06:45

CJLetsGame (211 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!