Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (494)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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
  ignore  |  Print  
  Space  (Read 14135 times)
0 Members and 1 Guest are viewing this topic.
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #30 - Posted 2012-10-18 16:42:26 »

Well i changed the code a little, so on any error the glow does not get rendered.

Could there be any mistake in the shader? (only started using them some days ago)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
uniform float radius;
uniform vec4 c;
varying vec4 screen;

float range;
vec4 color;

void main(void)
{
    range = length(screen.xy);
    color = c;

    if(range < radius){
       range = clamp(1 - (range / radius), 0, 1);
       color.w = range * (1 + (0.05 + 0.05 * fract(sin(dot(screen.xy, vec2(12.9898, 78.233)))* 43758.5453)));
    }else{
        color.w = 0;
    }


   gl_FragColor = color;
}


1  
2  
3  
4  
5  
6  
7  
varying vec4 screen;

void main(void)
{
   gl_Position = ftransform();
   screen = gl_Vertex;
}
Offline Tim Spekler
« Reply #31 - Posted 2012-10-18 20:18:09 »

Works fine for me. Seems really interesting, graphics are well done, planets are realistic and nice, a good start !   Grin
Offline matheus23

JGO Kernel


Medals: 107
Projects: 3


You think about my Avatar right now!


« Reply #32 - Posted 2012-10-18 20:19:24 »

I liked the old spaceship-design better...  Roll Eyes

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #33 - Posted 2012-10-18 21:38:17 »

Yeah it needs some tweaking, but now i have an gun mount and the first ship got to look very simple and rocket alike i think.

This way i can make the storyline like:
Youre the first creature from your homeplanet to leave the planet, so everything is unknown, some story blabla...

Thanks for the comments Smiley
Offline Grunnt

JGO Wizard


Medals: 67
Projects: 8
Exp: 5 years


Complex != complicated


« Reply #34 - Posted 2012-11-02 13:55:04 »

Hey Robin,

I found a GPL (as in: free to use for anything) sprite lib that I'm currently using in my game, in a modified form. Maybe you can use some sprites from that? It's got some cool space invaders / asteroids style sprites which may suite your space game (or may help you get started).

http://www.widgetworx.com/widgetworx/portfolio/spritelib.html

Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #35 - Posted 2012-11-02 14:05:13 »

In the future i want to make ships customizable, i only dont know what or how yet, so i wont use them for my ships.
Planets / astroids are going to be random generated.
Thanks anyways, i guess im going to use some as rockets and enemy's.
Im currently working on making teh planets more realistic planets + new types.

They seem nice for a stategy game however, maybe i shoud make a stategy game then Wink
But i guess ill stay with the rpg/shooter game, because there are much stategy games lately.
Offline masteryoom

JGO Coder


Medals: 5
Projects: 2


If you look closely, you might see it turning...


« Reply #36 - Posted 2012-11-05 09:25:42 »

Can't you make a jar file instead of a rar? (whatever a rar file is Grin) It only comes up in Notepad on my computer. *sigh*

Smiley
Offline Gjallar

JGO Coder


Medals: 13
Projects: 1


Follower of Nurgle


« Reply #37 - Posted 2012-11-05 09:36:23 »

Can't you make a jar file instead of a rar? (whatever a rar file is Grin) It only comes up in Notepad on my computer. *sigh*

Confirmed for troll  Roll Eyes
Offline masteryoom

JGO Coder


Medals: 5
Projects: 2


If you look closely, you might see it turning...


« Reply #38 - Posted 2012-11-05 09:39:28 »

What is a rar file then?  Angry

Smiley
Offline masteryoom

JGO Coder


Medals: 5
Projects: 2


If you look closely, you might see it turning...


« Reply #39 - Posted 2012-11-05 09:46:45 »

I also think Space is a good title. Pointing Wink Tongue Kiss Cheesy Smiley

Smiley
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Grunnt

JGO Wizard


Medals: 67
Projects: 8
Exp: 5 years


Complex != complicated


« Reply #40 - Posted 2012-11-05 10:10:06 »

1. What is a RAR file

RAR is the native format of WinRAR archiver. Like other archives, RAR files are data containers, they store one or several files in the compressed form. After you downloaded RAR file from Internet, you need to unpack its contents in order to use it.

http://www.rarlab.com/rar_file.htm

 Grin

Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #41 - Posted 2012-11-05 14:07:36 »

What is a rar file then?  Angry

Whow.. i expected everyone to know.
Well, next update i will use the .zip format.
Offline ra4king

JGO Kernel


Medals: 345
Projects: 3
Exp: 5 years


I'm the King!


« Reply #42 - Posted 2012-11-06 02:17:12 »

HOLY FSM Someone doesn't know what RAR is?

You must be part of that new younger generation everyone is scared of persecutioncomplex

Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 130
Projects: 4
Exp: 3 years



« Reply #43 - Posted 2012-11-06 03:03:19 »


What is a rar file then?  Angry

If I recall you didn't know what the command line was either... persecutioncomplex
How did you get past the registration filter? May be time to make it more difficult...
Offline ra4king

JGO Kernel


Medals: 345
Projects: 3
Exp: 5 years


I'm the King!


« Reply #44 - Posted 2012-11-06 03:08:55 »

Well it's not particularly hard to copy-paste a java sample and run it in Eclipse Tongue

Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 130
Projects: 4
Exp: 3 years



« Reply #45 - Posted 2012-11-06 03:10:01 »

Well it's not particularly hard to copy-paste a java sample and run it in Eclipse Tongue
true enough
Offline matheus23

JGO Kernel


Medals: 107
Projects: 3


You think about my Avatar right now!


« Reply #46 - Posted 2012-11-06 21:43:52 »

You must be part of that new younger generation everyone is scared of persecutioncomplex

*hehem*
LOL!
You're something like 18/19, aren't you?!?

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline ra4king

JGO Kernel


Medals: 345
Projects: 3
Exp: 5 years


I'm the King!


« Reply #47 - Posted 2012-11-07 00:13:34 »

You must be part of that new younger generation everyone is scared of persecutioncomplex

*hehem*
LOL!
You're something like 18/19, aren't you?!?
17 persecutioncomplex

Hey at least I know what the command line and RAR is Smiley

Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #48 - Posted 2013-01-22 11:54:42 »

I have picked up this project again, i have been doing some work on the planet generation algorithm (rewrote it).
Using 2 noise generators i can render planets with an 512 * 1024 texture within 600ms.

Preview:


Number 1 is supposed to be some sort of water planet with a few random islands.
Number 2 is some kind of carbon based planet close to the sun (lava planet).

So got any improvements for these planets?
Offline doos

Senior Member


Medals: 2
Projects: 2


Here be random


« Reply #49 - Posted 2013-01-23 19:37:10 »

Which method are you using to fit the texture fit the planet? I'm not seeing any obvious distortions, so I'm interested.

JME has this awesome class:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
// Some textures
     ProceduralTextureGenerator pt = new ProceduralTextureGenerator(
              heightMap);
          pt.addTexture(new ImageIcon(TestTerrain.class.getClassLoader()
                                      .getResource("jmetest/data/texture/grassb.png")),
                        -128, 0, 128);
          pt.addTexture(new ImageIcon(TestTerrain.class.getClassLoader()
                                      .getResource("jmetest/data/texture/dirt.jpg")),
                        0, 128, 255);
          pt.addTexture(new ImageIcon(TestTerrain.class.getClassLoader()
                                      .getResource("jmetest/data/texture/highest.jpg")),
                        128, 255,
                        384);

          pt.createTexture(256);


Basically, if you created your landscape image into greyscale (instead of your colour blend), loaded it as a heightmap in jme, then used that, it blends your terrain textures into the appropriate terrain levels.. So instead of using a colour range, it would be more detailed. You could also use the greyscale map as a bumpmap, or use the same method to make a spec map (shiny oceans). As an addition, you could also use your same technique for planets to create a transparent cloud image and draw that sphere outside your current one for atmosphere [EDIT: see you already have, nice one!].

If you post the texture from your planet generation algorithm, I can dump it into the program for you, see what you think?
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #50 - Posted 2013-01-23 22:55:49 »

Thank you for your reply.
Very nice ideas, im going to read about them Smiley

Im creating an (spherical) heightmap with this function:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
    protected void GeneratePerlinTerrain(){
        int hloc;
        float s, t, nx, ny, nz, sinv, pi_s, pi_t;
       
        for(int y = 0; y < height; y++){
            hloc = y*width;
            t = (float)y/width;
            pi_t = t * SimpleMath.PI2f;
            sinv = SimpleMath.sinf(pi_t);
            nz=SimpleMath.cosf(pi_t);
               
            for(int x = 0; x < width; x++){
                s = (float)x/width;
                pi_s = s * SimpleMath.PI2f;

                nx=SimpleMath.cosf(pi_s)*sinv;
                ny=SimpleMath.sinf(pi_s)*sinv;
               
                renderPixel(hloc+x, nx, ny, nz);
            }
        }
    }


The rendered sphere was just an UVSphere, but now i am working at an IcoSphere, so i can transform the globe nicely.
Im still thinking about how to render the terrain (especially when zooming in).
My main concern would be the level of detail when fully zoomed out:



Im not using images to create the texture, everything goes straight towards the texture buffer.
But i have made it possible to export the data to an image, so here you go, i am curious how it would look:

http://i48.tinypic.com/35i536f.png


Grayscale:
http://i45.tinypic.com/zk0gsl.png
Offline doos

Senior Member


Medals: 2
Projects: 2


Here be random


« Reply #51 - Posted 2013-01-24 00:46:01 »

Heres what I got as output:

https://www.dropbox.com/s/mcaqq4ak0drkxhn/newmap.jpg

And heres a render using that texture:



And I tried inverting the original map and using that as a spec map, but I didnt understand the settings so it overexposed most times, got this nice shot though:



Uh, the image export was in an odd size, sorry about that!
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #52 - Posted 2013-01-24 08:34:00 »

It looks better then expected, i guess i need to look into texturing then.
Would also be an much nicer transition when zooming into the planet.
Thanks for the help + info.
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #53 - Posted 2013-01-24 15:21:45 »

I have added some of the specular stuff you was talking about:



It looks very good, however i think messed somethign up, the reflection does not come so close to the shadow in real life.
Starting to realize my shader code is total nonsence ;P
Offline cheatsguy

Junior Member


Medals: 3


Gamer turned Pixel Artist turned Programmer


« Reply #54 - Posted 2013-01-24 17:11:25 »

Specular light comes from the brightness of the light source, so it should be pointing towards the light source, right?   Huh

Busy between school, work, life, games, programming and general screwing around.
If you'd like some pixel art for your game, send me a PM, i'll see what I can do.
Current project: http://elementalwarblog.wordpress.com/
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #55 - Posted 2013-01-24 19:39:01 »

Its an combination of viewing angle and light source, but i think i got it now:
I also tryd to take in account water reflects alot, and land almost does not reflect at all.





Next step: heightmap, bumbmap, and "glowmap" or something for planets on fire.
Any comments are welcome Smiley
Offline Ultroman

JGO Knight


Medals: 25
Projects: 1


Snappin' at snizzes since '83


« Reply #56 - Posted 2013-01-24 22:50:07 »

Looking good. Looking forward to pictures with the things you mentioned Smiley

- Jonas
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #57 - Posted 2013-01-25 11:59:33 »

Me to =)

I have added an function to distort the planet (just added random noise, to achieve an exaggerated effect):
Note: the normals are not updated with this noise, i need to figure out how to create some nice normals for this effect.



Looks kinda cool, and can be nice if i scale the effect down.
I guess im at an fork now: cartoonish or realistic....
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #58 - Posted 2013-01-25 13:49:22 »

Version with some normals:

Offline Danny02
« Reply #59 - Posted 2013-01-25 14:02:14 »



pls add gamma to your shader, otherwise the lighting looks so wrong Cheesy
just change the last line to
1  
   gl_FragColor = pow(color, 1. / 2.2);


update: did a quick search about what BRDF one should use for planets Smiley found a nice thesis with excatly this problem: http://www.frc.ri.cmu.edu/~uyw/pubs/uyw_thesis_final.pdf

The finding was this:
Considering only the four “traditional” graphics models:  limestone, granite and Spectralon are
Lambertian; coal, sandstone, JSC-1A, and CMU-1 are Torrance and gunite is an Oren-Nayar material. [J]ust three BRDFs  –
Lambertian, Oren-Nayar, and Torrance – are sufficient to span the reflective space of the domain.


update2:
to get realistic specular reflection of water on a planet you should use lean mapping:http://www.csee.umbc.edu/~olano/papers/lean/
Pages: 1 [2] 3
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

Dwinin (19 views)
2014-09-12 09:08:26

Norakomi (54 views)
2014-09-10 13:57:51

TehJavaDev (63 views)
2014-09-10 06:39:09

Tekkerue (31 views)
2014-09-09 02:24:56

mitcheeb (53 views)
2014-09-08 06:06:29

BurntPizza (37 views)
2014-09-07 01:13:42

Longarmx (23 views)
2014-09-07 01:12:14

Longarmx (27 views)
2014-09-07 01:11:22

Longarmx (26 views)
2014-09-07 01:10:19

mitcheeb (34 views)
2014-09-04 23:08:59
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!