Show Posts
|
|
Pages: [1] 2 3 ... 10
|
|
6
|
Java Game APIs & Engines / OpenGL Development / Re: Multiple shader passes LWJGL
|
on: 2013-05-15 13:27:54
|
Noo, calculating texture coordinates every pixel is expensive . Best way is to precalculate these vars: 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
| attribute vec4 a_position; attribute vec2 a_texCoord; varying vec2 v_texCoord; varying vec2 v_blurTexCoords[14]; void main() { gl_Position = a_position; v_texCoord = a_texCoord; v_blurTexCoords[ 0] = v_texCoord + vec2(-0.028, 0.0); v_blurTexCoords[ 1] = v_texCoord + vec2(-0.024, 0.0); v_blurTexCoords[ 2] = v_texCoord + vec2(-0.020, 0.0); v_blurTexCoords[ 3] = v_texCoord + vec2(-0.016, 0.0); v_blurTexCoords[ 4] = v_texCoord + vec2(-0.012, 0.0); v_blurTexCoords[ 5] = v_texCoord + vec2(-0.008, 0.0); v_blurTexCoords[ 6] = v_texCoord + vec2(-0.004, 0.0); v_blurTexCoords[ 7] = v_texCoord + vec2( 0.004, 0.0); v_blurTexCoords[ 8] = v_texCoord + vec2( 0.008, 0.0); v_blurTexCoords[ 9] = v_texCoord + vec2( 0.012, 0.0); v_blurTexCoords[10] = v_texCoord + vec2( 0.016, 0.0); v_blurTexCoords[11] = v_texCoord + vec2( 0.020, 0.0); v_blurTexCoords[12] = v_texCoord + vec2( 0.024, 0.0); v_blurTexCoords[13] = v_texCoord + vec2( 0.028, 0.0); }
|
|
|
|
|
|
7
|
Java Game APIs & Engines / OpenGL Development / Re: Multiple shader passes LWJGL
|
on: 2013-05-14 23:27:07
|
I ment rendering time, and it does affect some devices. My laptop with a HD3000 or something needs 1ms to render 1 fbo pass, but maybe thats an exception. I understand why i need two passes, thats why i created this thread. Also your tutorial explains this pretty clear =D Thansks for all of your info, it really helps. Now i only need to implement some liquid behaviour and then i can show the result  . Amazing presentation btw, this stuff is informative =D
|
|
|
|
|
9
|
Java Game APIs & Engines / OpenGL Development / Multiple shader passes LWJGL
|
on: 2013-05-14 19:03:15
|
Hello, Im having a simple question, of wich i can hardly find any info. How to use multiple shader passes on some rendered data? Usually i can just bind one shader (including one frag and vert shader), and do the drawing. But how does this work when i want to use 2 vertex shaders and one fragment shader for in example gaussian blur? And what should i do if i want do do another pass to post process this blurred data? So i want to do this: - one pass horizontal blur - one pass vertical blur - one pas post processing Is it possible do do this at once, or do i need to buffer the scene to a fbo each pass? Thanks in advance 
|
|
|
|
|
13
|
Game Development / Game Play & Game Design / Re: Big World vs Random Generated World
|
on: 2013-05-09 08:38:19
|
Think before you post  . I told about the scale: float value = SimplexNoise.noise(x / 1000, y / 1000); the higher the divider, the more smooth terrain. So dividing by one gives really raw (or even none) terrain. BTW, this will not work: 1 2 3 4 5 6
| if(value <= 0.8f){ level1[x][y] = 1; } else if(value <= 0.1f){ level1[x][y] = 0; } |
if an value is smaller then 0.8, its always smaller then 0.1, so it will never reach Keep paying attention programming is not really forgiving on mistakes 
|
|
|
|
|
15
|
Game Development / Game Play & Game Design / Re: Big World vs Random Generated World
|
on: 2013-05-06 23:22:09
|
Well im not really good with explaining, and the good people are not responding to this thread, so i guess ill give it another chance. with your example you can see there are 2 coordinates to take accout of. So going back to my loop: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| for(int x = 0; x < width; x ++){ for(int y = 0; y < height ; y ++){ float value = SimplexNoise.noise(x / 1000, y / 1000); if(value >= 0){ if(value < 0.1f){ }else if(value < 0.8f){ }else{ }
}else{ } } } |
This will give a basic impressen how to use the noise. For best results you could use some mathemathical functions like abs / clamp / sqrt or even sin / cos to create diffrent looking noise. Example: 1
| float value = Math.sqrt(SimplexNoise.noise(x / 1000, y / 1000)); |
Also try using multiple generators with diffrent seeds. Like one to create islands, one for terrain types, one for woods, mountains, rivers etc... At last, im using the scale 1 / 1000 in my example, just try some other values to see what it does  . Just try to make somethign from my example, and then try out some stuff.
|
|
|
|
|
16
|
Game Development / Game Play & Game Design / Re: Big World vs Random Generated World
|
on: 2013-05-06 18:46:58
|
depends on what you want. You should jus copy the noise class, there is no use of creating one for your own if you dont know what it does. when you got for example an 2d game where you want to create smooth hills you could do this for each pixel: float value = SimplexNoise.noise(x / 1000, 0); value would be beween -1 to 1, it seems useless but it isnt  . if the hills need to be max 100 px, then you could just say fill pixels from y = 0 to y = value * 100 at each x value. 1 2 3 4 5 6 7
| for(int x = 0; x < width; x ++){ float height = 50 + SimplexNoise.noise(x / 1000, 0) * 50; for(int y = 0; y < height ; y ++){ setRGB.... } } |
This could create a image like this:  
|
|
|
|
|
17
|
Discussions / General Discussions / Re: Hello to all :)
|
on: 2013-05-06 13:11:02
|
Thanks for the advice,
Me (the programmer) and my friend (who is a artists) are thinking of making a game, sandbox type game, NOT like minecraft of course, but a sandbox like type game, because it saves time on level design, well then again creating a good sandbox might be more difficult than normal linear level design but we feel it might require less level assets, and we aren't experienced level designers.
But I would like to make the game mod-able, how does one make it mod-able game, is it about exposing certain functionality of your game or just going full open-source type mode.
Thats some problems you ont even need to start thinking about, most people will not care about modding if your game sucs. Minecraft is not made to be modded, but its so populair, that people just started to decompile his code and making changes. During the design of your game you can keep in mind you want it to be modded, so you could read everythign from data (xml?) files, wich can be altered by other users. Sandbox does not mean random generated. Random terrain generation is much (very very much) harder then designing a level by hand, so dont do it because you think its easyer.
|
|
|
|
|
18
|
Discussions / General Discussions / Re: another Hello thread
|
on: 2013-05-06 13:02:19
|
Hello again! Thanks for your answers and sorry for that, I forgot to mention that I'm using Java2D. Generally I agree with you in all details about Java2D and about its weaknesses, but I will still use it for game programming although it isn't meant for that. I think the reason why I like to use Java2D is, that it's a real challenge particularly a lot of people say it's too slow, you can't make real games with it, etc... And only because a high amount of people have a rejection against it, when it comes to game programming, it doesn't mean, it's impossible to do it anyway! I also know, that it will be hard work and much more unpleasant, but I've also achieved good results in the past. And at the end the most important reason why I'm using it: It's incredible fun  (just before the 'learning experience'). So everyone else can now make his own come out. I know you all love java2D!  Yeah java2D is usable and kinda easy to use, untill you start asking to render some more heavy stuff. For a ververy simple platformer its no problem, but try creating some particle effects or even some cpu intensive tasks like collision or ai and you will start feeling really limited. At that time your probably advanced kinda far with the engine, and it will be a pain to port to the faster solution then. I also started in java2d and it seems really fun, but it sucs to see your fps go below 60 fps every time you add something. Nothing beats the raw power of opengl.
|
|
|
|
|
19
|
Game Development / Game Play & Game Design / Re: Big World vs Random Generated World
|
on: 2013-05-04 15:00:11
|
|
you should research some more about perlin noise (just copy some code) and start playing with it. Its overwhelming at first, but really worth it.
The problem with large (premade) land is the amount of work + saving the data + Its finite so players will start to regonise terrain after a while. Just try to find out more about terrain generation.
|
|
|
|
|
22
|
Game Development / Newbie & Debugging Questions / Re: Hi, just a few questions hehe
|
on: 2013-05-01 10:12:15
|
u_u it feels bad to give up on that (for now, i still want to do my own in a far future haha).
Btw does anyone know if there is a way to encrypt the images in the jar file? just for the game to be able to read the images and not people being able to take them off it. is it possible?
You can encrypt almost everything, but it does not matter anyways, since you need to decrypt them to use in your game anyways. People simply find your decryption code, and all your work is for nothing. If you made those images, they are automaticly your interlectual property, so copyrighted (well in my country, but i think this rule is globally used). So no worry's, first thig to do is try making something thats worth stealing to others haha 
|
|
|
|
|
23
|
Discussions / Miscellaneous Topics / Re: LUA + Minecraft Mod + Cluster Computing = ?
|
on: 2013-05-01 10:07:40
|
|
Simply connecting some computers with a network cable does not make it a super computer. with the delays and all the respose times are to slow to calculate the same thing parallel. Also he energy use would be crazy (a lot of power goes to unused stuff in the computers). If you want to create something really fast, you should try it more low level i think. Try to connect some fpga's together, and find out how easy hashes are brute forced, or other experiments like that (6)
|
|
|
|
|
24
|
Games Center / WIP games, tools & toy projects / Re: State of Fortune
|
on: 2013-04-30 12:10:33
|
|
Well, i think the best way is to create some kind of engine with the generic part, and buid the other code on top of that. I guess repositorys have some functionality to fork (parts of?) projects. I think you should create a new topic, because most people only get here to see your awsome game.
Your new terrain generation looks awsome, are you also going to create more diffrent terraisn like this? Like deserts, tundra, forests, or even some new concepts?
I still think your shadows are maybe a bit to much (very dark vs very light spots without reason), also the trees are awesome, but the grass is still a little to simple to become the same model type as the trees, it makes the world look more off.
|
|
|
|
|
25
|
Game Development / Newbie & Debugging Questions / Re: Why use VBOs/VAOs/FBOs/etc?
|
on: 2013-04-29 21:59:56
|
|
immediate mode is never an good solution in opengl (except some testing / debugging) since its depricated anyway. vbo's and vao's speed up your code, and forces the programmer to program some clean drawing code. So at least you will get cleaner code and faster drawing (much much faster).
|
|
|
|
|
29
|
Java Game APIs & Engines / OpenGL Development / 3D polygon triangulation algorithm
|
on: 2013-04-22 22:56:45
|
|
Hello,
For an simple experiment im trying to generate random 3D meshes. Now im having multiple points in 3d space that needs to be connected with triangles. Does anyone have some known algorith names or any point toward the correct direction? The only stuff i can find is about 2d polygons.
Thanks in advance. Robin
|
|
|
|
|
30
|
Game Development / Networking & Multiplayer / Re: Suggests for a 2d networked game
|
on: 2013-04-22 22:20:51
|
|
Simplest way is sending the position and direction 0.5 to 2 times a second (try out what looks / works best). for example: x, y, facing, iswalking facing would be the direction the player is looking,
Both the server and client should be receiving this data about all players.
So in your client, you need to animate the player between the frames (10 steps between old / new frame for example), otherwise it will just telport to the new positions. With frames i ment the dataframe you received about the player.
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|