Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 ... 7 8 [9] 10
 81 
 on: 2014-07-28 23:15:39 
Started by Ecumene - Last post by Ecumene
Nevermind.



1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
for (Box b : boxes) {
   GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
   ambient.bind();
   ambient.setUniformM4("projMatrix", true, camera.getProjection());
   ambient.setUniformM4("viewMatrix", true, camera.getView());
   
   ambient.setUniformi("diffuse", 0);
   ambient.setUniformf("ambientLight", 1f, 1f, 1f, 1f);
   ambient.setUniformM4("modelMatrix", false, b.model.transform.getM());
   b.render();
   ambient.unbind();
   
   GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
   
   for(Light light : lights){
      light.bind(camera, b);
      b.render();
      light.unbind();
   }
}


*Does a little dance*

 82 
 on: 2014-07-28 23:13:32 
Started by philfrei - Last post by philfrei
It would be nice to have in one place a tutorial on the current porting options (java to android, java to ios).

I'm seeing, for example, in going from Java to ios:

 - hand write code yourself (maybe not a terrible option, given Obj-C has a fair bit structurally in common with Java due to SmallTalk roots, but of course depends on the scale of the game and the use of libraries)
 - Avian
 - RoboVM
 - LibGDX
 - java2objc
 - multistep sort of thing: java to javascript/android, then javascript to obj-c as there are possibly more JavaScript to iOS options than from Java?

But for a Newbie, there is a lot of issues and steps involved that aren't immediately made clear by going to the various home pages for these resources. For example, if an embeddable VM has a reduced set of Java implemented, how are graphics and other IO (sound, mouse, touchpads, etc.) dealt with in each option?

Just an overview would be good, no need to get too detailed.

I'd write it myself if I were capable, but I don't have the needed knowledge. I'm pretty sure there are folks here that are well acquainted with the options and pros & cons of each.

I can guarantee I'd be one of the first to "appreciate" this if it were available. (Maybe there is already link at JGO I've overlooked?)

 83 
 on: 2014-07-28 22:59:11 
Started by tommohawkaction - Last post by philfrei
Roquen has a great tutorial post here on JGO.
http://www.java-gaming.org/topics/noise-bandpassed-white/27071/view.html

SiVi is an open-source project of mine that uses Ken Perlin's 3rd version of random noise (known as Simplex Noise). There is not a lot of explanation, but it does have examples of different outputs (including a topo map), and a hands-on interface where you can vary parameters and see what effect they have.

SiVi also has a pretty simple working code example in the "help" area with lots of comments, including some notes on how to make a topo map. You can download a jar and get immediate access to this via the following link. http://hexara.com/SiVi.jar

In the below image (not the greatest terrain example, I'll admit), is an example of a mapping to a color bar with 256 increments (on the right) to get terrain. The number ranges and colors I choose are arbitrary. You can define your own for game purposes (e.g., 0 to 63 = water, 64 to 127 = forest, etc., and map to graphics used for those topo features, rather than to color gradients.




More SiVi info & examples, but will eventually expire:
http://www.java-gaming.org/topics/wip-reel/33731/msg/317526/view.html#msg317526
This post also has a link to an interesting slide show by Ken Perlin.

Since the project is open source, you can also sign up on github (http://github.com/philfrei/SiVi) and poke around the code that way.

 84 
 on: 2014-07-28 22:54:11 
Started by CopyableCougar4 - Last post by CaptainJester
Generally I agree with the idea that you should only ever roll something yourself if learning is what matters to you and not productivity, but Java has 3 built-in ways of parsing XML (DOM, SAX, StAX) which are all really easy to use so why would anyone use a library for this? Huh
Because you still have to do the marshaling yourself. With SimpleXML you create POJOs and then use a serializer to read/write your XML file. All the marshaling is done for you.

 85 
 on: 2014-07-28 22:47:05 
Started by CTucker1327 - Last post by CTucker1327
KyroNet is better than Netty?

Could you please provide more information? I can't find any benchmark comparisons, etc.

The reason I chose Netty was due to the fact I use a C# based client.
I was reading the KyroNet didn't support C# Clients, as it used a special network layer? Not sure, never got into it.

 86 
 on: 2014-07-28 22:22:28 
Started by tommohawkaction - Last post by BurntPizza
Matheus has what looks like a good simplex noise implementation in his utils collection: https://github.com/matheus23/Utils

 87 
 on: 2014-07-28 22:06:09 
Started by GNecro1 - Last post by Ecumene
Here's an amazing tutorial on what shaders do:
https://www.youtube.com/watch?v=bgckX62f4EA

And for loading shaders into java objects, I don't mind you cheating off my implementation (It's not finished, but its working):
https://github.com/ecumene-software/LibEcu/blob/master/source/ecumene/opengl/Shader.java

Some example code on how to load/use them from my object:
1  
2  
3  
4  
5  
6  
7  
8  
9  
ambient = new Shader();
//Attaching source files:
ambient.attachShaderSource(new File("./assets/shaders/ambient.fs"), GL20.GL_FRAGMENT_SHADER);
ambient.attachShaderSource(new File("./assets/shaders/ambient.vs"), GL20.GL_VERTEX_SHADER);
//Using them with VAOs:
ambient.bindAttribute(0, "in_Position");
ambient.bindAttribute(1, "in_TextureUV");
ambient.bindAttribute(2, "in_Color");
ambient.link();


For rendering something with the shader:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
ambient.bind();
        //Uniforms can only be set after the shader is being used!!!
       //Setting uniform matrices
  ambient.setUniformM4("projMatrix", true, camera.getProjection());
   ambient.setUniformM4("viewMatrix", true, camera.getView());
   
        //For setting "samplers" with "texture units (multi-texture)" use glUniformi NOT glUniformf
  ambient.setUniformi("diffuse", 0);
        //For setting a uniform vec4 (vector 4 data being used as a color)
  ambient.setUniformf("ambientLight", 1f, 1f, 1f, 1f);
        renderMyObjects();
ambient.unbind();


EDIT: And if you have any small questions, just PM me, I'm fine with that. Smiley

 88 
 on: 2014-07-28 21:53:58 
Started by joaogl - Last post by quew8
The min function in GLSL works component wise for any type of vector (except booleans). So:

1  
gl_FragColor = min(existing, calculated);


will result in the darkest colour (Manhattan distance style, not absolute magnitude).

 89 
 on: 2014-07-28 21:48:11 
Started by CogWheelz - Last post by CogWheelz
I created an int for the x and y and gave both the bdef and the sprite that position. The sprite moves to the location but the body's gravity moves and the sprite stays static. How do I constantly render the sprite in the body's location?

 90 
 on: 2014-07-28 21:36:11 
Started by Ecumene - Last post by Ecumene
Okay, I drew up an image of what's happening:


Pages: 1 ... 7 8 [9] 10
 

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

The first screenshot will be displayed as a thumbnail.

Riven (12 views)
2014-07-29 18:09:19

Riven (8 views)
2014-07-29 18:08:52

Dwinin (9 views)
2014-07-29 10:59:34

E.R. Fleming (25 views)
2014-07-29 03:07:13

E.R. Fleming (10 views)
2014-07-29 03:06:25

pw (39 views)
2014-07-24 01:59:36

Riven (39 views)
2014-07-23 21:16:32

Riven (27 views)
2014-07-23 21:07:15

Riven (28 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!