Java-Gaming.org Hi !
Featured games (88)
games approved by the League of Dukes
Games in Showcase (679)
Games in Android Showcase (194)
games submitted by our members
Games in WIP (732)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2] 3 4 ... 10
 11 
 on: 2016-05-28 08:50:47 
Started by useless - Last post by useless
@thedanisaur tried it, no help.


@theagentd
I added these two lines just before storing the buffer to opengl, is this what you meant?

1  
2  
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);


Didnt help tough.

 12 
 on: 2016-05-28 08:38:14 
Started by useless - Last post by theagentd
I didn't read the entire thread, but I see no glTexParameteri() calls to set up filtering. The default near filter enables mipmapping, so if you don't have mipmaps defined the texture is considered incomplete and won't be readable from shaders.

 13 
 on: 2016-05-28 08:30:16 
Started by stuart6854 - Last post by theagentd
Another very common problem is when you have a big world and need good precision matrices. Let's say you have a camera tracking an object at position (10 000 000, 10 000 000, 0). In this case, you would end up adding 10 000 000 to the XY coordinates of the model's vertices when multiplying by the model matrix, then subtracting 10 000 000 again when multiplying by the view matrix (which transforms the matrices to positions relative to the camera). At a scale of 10 000 000, 32-bit floats only have a 1.0 precision, meaning that every single vertex will essentially be rounded to the nearest integer coordinates after this transformation. If you were to precompute a model-view matrix by multiplying the two matrices together, you would end up with a similar but less severe precision problem as the individual vertices would not suffer from horrible precision (the shape of the model isn't completely broken) but the position of the camera and the translation of the model will still suffer from the same precision problem, causing objects to appear to stutter around. However, if you were to compute the model-view matrix at double precision and then finally upload it to OpenGL at 32-bit precision the matrix multiplication is carried out with such precision that you would need larger values than 10 000 000 before the precision of the final 32-bit matrix starts to suffer at all, and even farther before you actually start noticing problems due to that.

 14 
 on: 2016-05-28 08:18:29 
Started by useless - Last post by thedanisaur
Java doesn't support unsigned integers, not a problem when moving over to openGL. Anyway, the values are non-zero which means you should at least have color.

I'm at a loss though, it looks fine to me. Another thing you can try is checking each channel individually in your shader

vec4 color = texture(sampler, pass_texCoords);
out_color = vec4(color.r, color.r, color.r, 1.0);<- could be that the alpha channel is messed up, but I'm pretty sure 255 == 1.0.

 15 
 on: 2016-05-28 08:12:46 
Started by noctarius - Last post by Icecore
I want
1  
2  
class A extends B,C,D{
}

Is everyone don’t care?
You can make List<int> - by making custom List class with int[]
You can make operator overloads – by calling fun mul(a,b)
You can send fun as param
1  
2  
3  
4  
interface Fun<E>{
    public Do();
    public Do(E params);
}

You can even serialize and memory copy by Unsafe and direct buffer

But You can’t make struct(class) extend from 2 structs (classes)
Its fundamental JVM problem Sad

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
class AA extends B,C,D{
}
class BB extends B,C,D{
}

fun(B data){
    do_B(data);
    if(data instanceof C){
        do_C(data);
    }
    if(data instanceof D){
        do_D(data);
    }
}
<T extends B & C & D> fun(T data){
    do_B(data);
    do_C(data);
    do_D(data);
}

up: i don't think its good solution ^^
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
   class B_Data{}
   class C_Data{}
   class D_Data{}
   
   interface B{public B_Data get_B_Data();}
   interface C{public C_Data get_C_Data();}
   interface D{public D_Data get_D_Data();}
   class AA implements B, C, D{
      B_Data bd;
      public B_Data get_B_Data(){return bd;}
      C_Data cd;
      public C_Data get_C_Data(){return cd;}
      D_Data dd;
      public D_Data get_D_Data(){return dd;}
     
      public<T extends B & C & D> void Fun(T data){
         do_B(data);
         do_C(data);
         do_D(data);
      }
      public void do_B(B data){}
      public void do_C(C data){}
      public void do_D(D data){}
   }

What you think?)

 16 
 on: 2016-05-28 07:52:39 
Started by stuart6854 - Last post by stuart6854
It's not unreasonable to use double quaternions/matrices for this reason. I use double precision view and projection matrices and convert the matrices to float matrices when uploading them to OpenGL.

Wow, thanks @theagentd! Using Vector3d's, quaterniond's, etc. has fixed the issue Smiley

 17 
 on: 2016-05-28 07:27:44 
Started by useless - Last post by useless
@Hydroque I get a black screen.

In my bytebuffer I have something like this after its flipped, i got this using ByteBuffer.get(i) method, it doesnt look right, why is this signed, why would there be minus values in rgba format? Or this whole thing gets cast to unsigned byte when it goes to GPU? Its not the whole output but you get the picture. Image is 256x256.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
26
20
12
-1
103
83
48
-1
-98
126
73
-1
-98
126
73
-1
-98
126
73
-1
-99
125
71
-1
-99
125
71
-1
-99

 18 
 on: 2016-05-28 06:45:34 
Started by stuart6854 - Last post by theagentd
It's not unreasonable to use double quaternions/matrices for this reason. I use double precision view and projection matrices and convert the matrices to float matrices when uploading them to OpenGL.

 19 
 on: 2016-05-28 04:19:04 
Started by DarkCart - Last post by ziozio
That's an article written by the Oracle lawyer  Smiley

 20 
 on: 2016-05-28 04:00:19 
Started by useless - Last post by Hydroque
What happens when you do...

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
#version 430 core

in vec2 pass_texCoords;
layout (binding=0) uniform sampler2D sampler;

out vec4 color;

void main()
{
    color = texture(sampler, pass_texCoords);
}

Pages: 1 [2] 3 4 ... 10
 
Hydroque (18 views)
2016-05-26 14:45:46

Mac70 (40 views)
2016-05-24 21:16:33

theagentd (42 views)
2016-05-14 18:38:35

theagentd (76 views)
2016-05-10 22:37:41

theagentd (84 views)
2016-05-10 22:33:46

IanParcs (110 views)
2016-04-18 14:18:53

KaiHH (108 views)
2016-04-18 08:35:41

KaiHH (131 views)
2016-04-15 12:43:58

theagentd (135 views)
2016-04-14 02:16:17

theagentd (158 views)
2016-04-14 02:15:43
FPS Camera Tutorial
by Hydroque
2016-05-22 05:40:58

Website offering 3D Models specifically for games for free
by vusman
2016-05-18 17:23:09

Website offering 3D Models specifically for games for free
by vusman
2016-05-09 08:50:56

Website offering 3D Models specifically for games for free
by vusman
2016-05-06 11:10:21

Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17

List of Learning Resources
by SilverTiger
2016-02-05 09:39:47

List of Learning Resources
by SilverTiger
2016-02-05 09:38:38

List of Learning Resources
by SilverTiger
2016-02-05 09:35:50
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!