RobinB
|
 |
«
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; } |
|
|
|
|
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 ! 
|
|
|
|
matheus23
|
 |
«
Reply #32 - Posted
2012-10-18 20:19:24 » |
|
I liked the old spaceship-design better... 
|
|
|
|
Games published by our own members! Check 'em out!
|
|
RobinB
|
 |
«
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 
|
|
|
|
Grunnt
|
 |
«
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
|
|
|
|
RobinB
|
 |
«
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  But i guess ill stay with the rpg/shooter game, because there are much stategy games lately.
|
|
|
|
masteryoom
|
 |
«
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  ) It only comes up in Notepad on my computer. *sigh*
|
|
|
|
Gjallar
|
 |
«
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 ) It only comes up in Notepad on my computer. *sigh* Confirmed for troll 
|
|
|
|
masteryoom
|
 |
«
Reply #38 - Posted
2012-11-05 09:39:28 » |
|
What is a rar file then? 
|
|
|
|
masteryoom
|
 |
«
Reply #39 - Posted
2012-11-05 09:46:45 » |
|
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Grunnt
|
 |
«
Reply #40 - Posted
2012-11-05 10:10:06 » |
|
1. What is a RAR fileRAR 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 
|
|
|
|
RobinB
|
 |
«
Reply #41 - Posted
2012-11-05 14:07:36 » |
|
What is a rar file then?  Whow.. i expected everyone to know. Well, next update i will use the .zip format.
|
|
|
|
ra4king
|
 |
«
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 
|
|
|
|
Jimmt
|
 |
«
Reply #43 - Posted
2012-11-06 03:03:19 » |
|
What is a rar file then?  If I recall you didn't know what the command line was either...  How did you get past the registration filter? May be time to make it more difficult...
|
|
|
|
ra4king
|
 |
«
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 
|
|
|
|
Jimmt
|
 |
«
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  true enough
|
|
|
|
matheus23
|
 |
«
Reply #46 - Posted
2012-11-06 21:43:52 » |
|
You must be part of that new younger generation everyone is scared of  *hehem* LOL! You're something like 18/19, aren't you?!?
|
|
|
|
ra4king
|
 |
«
Reply #47 - Posted
2012-11-07 00:13:34 » |
|
You must be part of that new younger generation everyone is scared of  *hehem* LOL! You're something like 18/19, aren't you?!? 17 Hey at least I know what the command line and RAR is 
|
|
|
|
RobinB
|
 |
«
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?
|
|
|
|
doos
|
 |
«
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
| 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?
|
|
|
|
RobinB
|
 |
«
Reply #50 - Posted
2013-01-23 22:55:49 » |
|
Thank you for your reply. Very nice ideas, im going to read about them  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
|
|
|
|
doos
|
 |
«
Reply #51 - Posted
2013-01-24 00:46:01 » |
|
Heres what I got as output: https://www.dropbox.com/s/mcaqq4ak0drkxhn/newmap.jpgAnd 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!
|
|
|
|
RobinB
|
 |
«
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.
|
|
|
|
RobinB
|
 |
«
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
|
|
|
|
cheatsguy
Junior Devvie   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? 
|
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/
|
|
|
RobinB
|
 |
«
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 
|
|
|
|
Ultroman
|
 |
«
Reply #56 - Posted
2013-01-24 22:50:07 » |
|
Looking good. Looking forward to pictures with the things you mentioned 
|
- Jonas
|
|
|
RobinB
|
 |
«
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....
|
|
|
|
RobinB
|
 |
«
Reply #58 - Posted
2013-01-25 13:49:22 » |
|
Version with some normals: 
|
|
|
|
Danny02
|
 |
«
Reply #59 - Posted
2013-01-25 14:02:14 » |
|
pls add gamma to your shader, otherwise the lighting looks so wrong  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  found a nice thesis with excatly this problem: http://www.frc.ri.cmu.edu/~uyw/pubs/uyw_thesis_final.pdfThe 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/
|
|
|
|
|