Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (575)
Games in Android Showcase (154)
games submitted by our members
Games in WIP (623)
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 5 ... 10
 21 
 on: 2015-04-26 18:46:46 
Started by Lucasmontec - Last post by Lucasmontec
This trail isn't about the frame buffer. Frame buffer trails are related to translation or rotation (movement in general) because the last frame is always kept. This trails is because I'm drawing a region of the sprite that has 'nothing' on it. I think when I call the method, opengl just replicates the last row of pixels. Anyway, the problem is solved. Using trickery but still... solved.
KOP - Kludge Oriented Programming.

 22 
 on: 2015-04-26 18:37:23 
Started by MALLEKMIROX - Last post by jonjava
http://www.java-gaming.org/topics/loading-a-bufferedimage/30470/msg/282671/view.html#msg282671

http://www.java-gaming.org/topics/having-an-issue-loading-text-files/30433/msg/281026/view.html#msg281026

 23 
 on: 2015-04-26 18:34:24 
Started by Cyraxx - Last post by Riven
You 'store' them as regular objects, or whatever you prefer, anything that allows you to make the appropriate gl-calls in between draw-calls.

 24 
 on: 2015-04-26 18:25:17 
Started by TehJavaDev - Last post by robocos987
What happened to OP? This project could have went somewhere... Sad Sad

 25 
 on: 2015-04-26 18:18:41 
Started by tommohawkaction - Last post by quew8
OK so here's a really simple example of lighting using a single white point light using a square attenuation model.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
#version 400 core

in vec3 position;
in vec2 textureCoords;

out vec2 out_TextureCoords;
out vec2 out_WorldPos; //The untransformed position

uniform mat4 projectionMatrix;
uniform mat4 transformationMatrix;
uniform mat4 viewMatrix;

void main(void){
   out_TextureCoords = vec2(textureCoords.x,textureCoords.y);

   vec4 worldView = viewMatrix * transformationMatrix * vec4(position,1.0);
   
   out_WorldPos = position.xy;
   gl_Position = projectionMatrix * worldView;
}


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
#version 400 core
#define ATTENUATION_COEFFICIENT 0.1 //fine tune to get it how you want it

in vec2 out_TextureCoords;
in vec2 out_WorldPos; //The untransformed position

out vec4 out_Colour;

uniform sampler2D texture0;
uniform vec3 light; //x, y refer to position. z refers to intensity.

void main(void){
   float d = length(light.xy -  out_WorldPos);
   float a = light.z / (d * d * ATTENUATION_COEFFICIENT);
   out_Colour = a * texture(texture0, out_TextureCoords);

}


I HAVE NOT TESTED THIS CODE. It should give you an idea of how to go about this even if it doesn't work.

 26 
 on: 2015-04-26 17:53:01 
Started by hansielneff - Last post by CopyableCougar4
I would choose LWJGL. Java2D is less geared towards games and more towards corporate software (ie. their complete UI package and complete control over rendering).

 27 
 on: 2015-04-26 17:50:57 
Started by hansielneff - Last post by hansielneff
But, where would I wanna go to learn making games with Java2D? And what should I choose: Java2D or LWJGL?
Please guide me, people!

 28 
 on: 2015-04-26 17:30:59 
Started by Cyraxx - Last post by theagentd
Thanks for the answer Rive. Unfortunately, I'm not too experienced with OpenGL so could you please tell me how your idea actually work, or point me where I can learn about it? (How to store state changes and render them after eachother)
You don't store state changes. You simply first upload all the data to different buffers, then do all the state change and draw calls afterwards.

 29 
 on: 2015-04-26 17:23:58 
Started by theOne - Last post by CopyableCougar4
Found some code online with a quick google that works:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
public int interpolationSearch(int[] array, int value, int from, int to){
       if(array[from] == value) return from;
       else if(from == to || array[from] ==  array[to]) return -1; //not found

       //probable position of the searched value
      int index = from + ((to - from)/(array[to] - array[from])) * (value - array[from]);
       
       if(array[index] == value) return index;//found
       //continue in the right part of the array
       else if(array[index] < value) return interpolationSearch(array, value, index + 1, to);
       //continue in the left part of the array
       else return interpolationSearch(array, value, from, index - 1);
   }


The highlighted line is where your implementation broke.

 30 
 on: 2015-04-26 17:05:09 
Started by hansielneff - Last post by AirTime
I'd recommend starting with something like Java2D, which is simpler than just jumping headfirst into an OpenGL binding like LWJGL then, once you feel confident with that, move on to something like Slick2D, which, despite being outdated, is still a sort of bridge between Java2D and LWJGL to me at least. Then, one you feel good with slick, THEN move on to LWJGL or JOGL. Just my 2 cents.

Pages: 1 2 [3] 4 5 ... 10
 
BurntPizza (29 views)
2015-04-23 03:42:11

theagentd (35 views)
2015-04-22 16:23:07

Riven (48 views)
2015-04-16 10:48:47

Duke0200 (59 views)
2015-04-16 01:59:01

Fairy Tailz (41 views)
2015-04-14 20:13:12

Riven (43 views)
2015-04-12 21:36:37

bus hotdog (60 views)
2015-04-10 02:39:32

CopyableCougar4 (66 views)
2015-04-10 00:51:04

BurntPizza (69 views)
2015-04-06 22:06:58

ags1 (67 views)
2015-04-02 10:58:48
How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27
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!