Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (569)
Games in Android Showcase (154)
games submitted by our members
Games in WIP (618)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3 ... 29
1  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-16 04:46:41
Learned a bunch more about compilers and how they turn nasty code into nice, optimized ASM. Very beneficial for my RE skills!
2  Game Development / Game Play & Game Design / Re: SSAO Problem on: 2015-04-14 01:01:28
This is giving me a similar, albeit much more grainy, output... I must be doing something wrong when I'm storing the normals or depth. All the math for the actual SSAO seems perfect from what I can tell. I thought I had to use the view space normals, tried multiplying the normal by the inverse of the projection matrix to get that, and it still didn't work correctly. Maybe I'm not using the correct depth?

I store normals and depth like

1  
gl_FragColor = vec4(v_normal, v_position.z / v_position.w);


where v_position is

1  
v_position = u_projViewTrans * u_worldTrans * vec4(a_position, 1.0);


and I have also introduced a LinearizeDepth function, so now I know for sure that depth is linearized. But, still no dice. Also, when I use my other code, not using the normals to do the falloff, I still get banding, as expected.
So, either I've got to find a different way to get rid of self occlusion, or I've got to fix some error with my normals... Ideas, theagentd? Thanks a bunch for all your help btw.
3  Game Development / Game Play & Game Design / Re: SSAO Problem on: 2015-04-13 21:16:17
Just got some more time to work on this recently. Here's my code now:

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  
27  
28  
29  
30  
31  
32  
// in Java, here's the vec2 I pass in for u_frustumCorner:

Vector3 tmpFrustCorner = new Vector3(1, 1, 1).prj(cam.projection.cpy().inv());
Vector2 frustCorner = new Vector2(tmpFrustCorner.x / -tmpFrustCorner.z, tmpFrustCorner.y / -tmpFrustCorner.z);

// in shader

vec3 CalcPos(float depth)
{
   float linearDepth = depth;
   return vec3((v_texCoords * 2.0 - 1.0) * u_frustumCorner, -1) * linearDepth;
}

void main() {
   vec4 normDepth = texture2D(u_normalDepthTexture, v_texCoords);
   float linearDepth = normDepth.a;
   vec3 position = CalcPos(normDepth.a);
   vec3 normal = normDepth.xyz;
   //mat3 rotMat = CalcRotMat(normDepth.xyz);
   
   float occlusion = 0.0;
   for (int i = 0; i < u_sampleKernelSize; ++i) {
      vec2 sample = poisson16[i] * u_radius + v_texCoords;
      float depthAtPixel = texture2D(u_normalDepthTexture, sample).a;
      vec3 viewSpaceSample = CalcPos(depthAtPixel);
     
      float rangeCheck= abs(linearDepth - depthAtPixel) < u_radius ? 1.0 : 0.0;
      occlusion += (depthAtPixel <= linearDepth ? 1.0 : 0.0) * rangeCheck;
   }
   
    gl_FragColor = vec4(1.0 - (occlusion / float(u_sampleKernelSize)));
}


And here's the result:



It looks like it's actually doing something here... Am I doing something wrong, or am I just encountering a common artifact that can be fixed somehow?
Thanks.
4  Games Center / WIP games, tools & toy projects / Re: 2D Terrarian engine on: 2015-04-13 20:40:41
Note that doing it without shaders isn't necessarily a good thing. But it looks nice, good job.
5  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-09 03:26:51
Received my 4x4 in the mail, and after a few hours solved it intuitively. Now off to find faster methods of solving it.
Programming wise, implemented particles into my game as a nice addon, which is due for the state competition in a couple weeks. It's mostly done from regionals, but there are just... bugs... mountains and mountains of slimy, multilegged, mutant bugs that seem to love reproducing like rabbits.
6  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-07 18:57:45
Bought a 4x4 cube online, can't wait to get it and start messing around with it Smiley Smiley
7  Game Development / Game Play & Game Design / Re: SSAO Problem on: 2015-04-03 22:50:15
Thanks for the response. I'll fix those problems, they seem pretty easy. I understand the implementation a lot better now.
When you say 'frustum corner' can I use any of them? I was under the assumption that there's 8. I see you have a vec2 there.. I think I'm thinking of the wrong frustum corners...
8  Game Development / Game Play & Game Design / SSAO Problem on: 2015-04-03 00:24:14
I've got a problem with an SSAO shader I'm working on. For some reason, it doesn't seem to do anything at all. I'm correctly getting the position and linear depth (see pics below), but unfortunately it's not outputting anything.. Whole screen is white. You can assume that I've debugged it to the point that it's definitely the shader code, not something CPU side.

I store the depth and normals in one texture then linearize the depth in the SSAO shader. Here's the main code:

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  
27  
28  
void main() {
   vec4 normDepth = texture2D(u_normalDepthTexture, v_texCoords);
   vec3 position = CalcPos(normDepth.a);
   //mat3 rotMat = CalcRotMat(normDepth.xyz);
   
   float occlusion = 0.0;
   
   for(int i = 0; i < u_sampleKernelSize; i++)
   {
      vec3 sample = u_sampleKernel[i];
      sample = sample * u_radius + position;
     
      vec4 offset = u_proj * vec4(sample, 1.0);
      offset.xy /= offset.w;
      offset.xy = offset.xy * 0.5 + 0.5;
     
      vec4 sampleColor = texture2D(u_normalDepthTexture, offset.xy);
      float sampleDepth = sampleColor.a;
      float linearSampleDepth = (2.0 * u_projAB.x) / (u_cam.y + u_cam.x - sampleDepth * (u_cam.y - u_cam.x));
     
      if(abs(position.z - linearSampleDepth) < u_radius)
      {
            occlusion += (linearSampleDepth <= sample.z) ? 1.0 : 0.0;
        }
   }
   
    gl_FragColor = vec4(1.0 - (occlusion / float(u_sampleKernelSize)));
}


and CalcPos if necessary:

1  
2  
3  
4  
5  
6  
vec3 CalcPos(float depth)
{
   float linearDepth = (2.0 * u_cam.x) / (u_cam.y + u_cam.x - depth * (u_cam.y - u_cam.x));
   vec4 pos = u_invProj * vec4(v_texCoords * 2.0 - 1.0, linearDepth, 1.0);
   return pos.xyz / pos.w;
}


I haven't implemented noise or kernel orientation yet, I just want to get the basics working.

Reconstructed position:



Depth (non linear):



I'd appreciate any help. Thanks Smiley
9  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-02 00:19:04
Installed OSX on my laptop and got a 25 second Rubiks solve. Pushing to sub 20!
10  Game Development / Newbie & Debugging Questions / Re: LWJGL - Shadow issue and need tips on: 2015-03-27 02:28:37
Well yes, but you're going to need to have those standard buffers (normal, depth, so on) for all advanced effects that require sampling in a kernel. Light shafts, soft shadows, and others.
11  Game Development / Newbie & Debugging Questions / Re: LWJGL - Shadow issue and need tips on: 2015-03-27 00:03:01
SSAO is the go to method. It's really easy to implement and relatively cheap. Just kidding. It really hurts performance if done incorrectly.
12  Game Development / Newbie & Debugging Questions / Re: Best tutorials on the basics? on: 2015-03-24 04:29:55
There's a bunch of "Which lib do I choose?" threads as well if you want to check them out. What you're doing right now, however, is useless because you're giving us no context as to where you are experience-wise. Details, maybe?
13  Game Development / Newbie & Debugging Questions / Re: Best tutorials on the basics? on: 2015-03-24 03:45:53
google.com

I'm serious.
14  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-03-23 04:36:15
Bought my first car, a 1999 Plymouth Breeze with around 100k miles for the low price of $2,000! Now I just have to find insurance for it. Can't wait to be raped financially by insurance companies. Being a teenage boy definitely has it's drawbacks sometimes...

Congrats Smiley I should probably get off my butt and get my license as well. I'm fully qualified at this point, I just haven't gone and done the tests.. Not looking forward to paying for all that though.
15  Discussions / Miscellaneous Topics / Re: Crash - Corrupt File, Months of Work Lost on: 2015-03-20 21:20:48
Yeah fortunately I did find an exe and decompile it to get the base code. Unfortunately the variable names are crap but right now I'm trying to use the PDB to get them back as well. I now have everything backed up in the cloud and an external drive.
16  Discussions / Miscellaneous Topics / Re: Crash - Corrupt File, Months of Work Lost on: 2015-03-20 06:11:31
Well the nightmare is over! I retried decompiling, and tried a different exe I hadn't checked before... And there we go. Code saved. Of course the decompiler outputted some funky names for variables but other than that, everything is intact. I am so relieved right now. Wow. Off to github.
17  Discussions / Miscellaneous Topics / Re: Crash - Corrupt File, Months of Work Lost on: 2015-03-20 05:55:54
I'll look into some more data recovery software but I'm not hopeful... Unfortunately when I tried to run the code for the first time after the crash it produced some exe for some reason that's unexecutable. I've given up really.

EDIT: I SEE LIGHT I REPEAT I SEE LIGHT WILL UPDATE SHORTLY
18  Discussions / Miscellaneous Topics / Re: Crash - Corrupt File, Months of Work Lost on: 2015-03-20 05:32:05
I said in the op that I wasn't. I know. Don't lecture me on it. I'm retarded.
19  Game Development / Game Mechanics / Re: Push objects when walking into them on: 2015-03-20 04:02:12
Thank you for introducing me to my new favorite sub on a bad day. I love you. I'm very emotional right now.
20  Discussions / Miscellaneous Topics / Re: Crash - Corrupt File, Months of Work Lost on: 2015-03-20 02:14:45
Dammit. It doesn't affect it. Jesus... Well.. I guess it's over. This really really sucks, badly. Probably the most crushing and demotivating thing to happen to me, ever. I'm not exaggerating when I say 200+ hours of work. This was my Battlefield hack. My reversed SDK, GUI code, mathematics, everything. So this isn't just my code, this is the time I spent reverse engineering the game. This is so messed up.
I suppose I'll be uploading everything to github every 10 minutes from now on....

I need therapy Sad please send ice cream
21  Discussions / Miscellaneous Topics / Re: Crash - Corrupt File, Months of Work Lost on: 2015-03-20 02:08:45
I haven't... I'll do the CHKDSK and if that doesn't work I'll try to do a restore. The last point was about a week ago but the only code I've written since then was a bit of radian lerp code which shouldn't be hard at all to rewrite. I just have to hope and hope that it affects my file. Thanks for reminding me; If this works I'll... I don't know but I will love you.
22  Discussions / Miscellaneous Topics / Re: Crash - Corrupt File, Months of Work Lost on: 2015-03-20 02:00:46
Unfortunately that's only for specified folders.. No dice Sad
It's really kind of starting to sink in now. God this f**king sucks. I suppose nobody else has any suggestions...?
23  Discussions / Miscellaneous Topics / Re: Crash - Corrupt File, Months of Work Lost on: 2015-03-20 01:45:53
Windows
24  Discussions / Miscellaneous Topics / Crash - Corrupt File, Months of Work Lost on: 2015-03-20 01:40:10
I flipping my shit right now, big time. I was working on a large project and my computer blue screened and when I booted back up the ONE important source file I needed was corrupted somehow. It's a .cs file and it's 1.5k+ lines long. Losing it is NOT an option. I haven't done any backups either because I'm stupid. I've tried using Recuva, it gives me a partially complete file but around 1k lines are still NULL. There are no other versions of the file on the disk, Visual Studio didn't make any backups. Essentially I'm completely screwed right now unless you guys can give me any help. I've worked for at least 6 months on this project and if I lost it... I don't know that's just incomprehensible.

I've decompiled the binary of the apparent last build but the code it gives me is at least 4 months old so the majority of my modern code is missing. I haven't run a CHKDSK /f yet because I'm using that as a last resort just in case any you guys ideas require me to not have rebooted.

Please help me out here. I'm dying.
25  Game Development / Game Mechanics / Re: Push objects when walking into them on: 2015-03-20 00:49:17
I'll just be sure to avoid posting here next time. Thanks.

Don't avoid posting here, we're here to help you. However as Gibbo said, many of your questions provide little context and seem to present no effort from your side. If you have a problem and you've tried to fix it yourself for at least a couple hours you can and should post here. But the majority of the learning process for programming in general is just trying things out yourself instead of relying on others. The difference between a great coder and an amateur is the amount of hand holding they require.
26  Game Development / Newbie & Debugging Questions / Re: Velocity Slide Effect on: 2015-03-18 05:14:28
Your original method should work, at least mathematically.. Check your code again and step through it. You probably have a bug somewhere. You could also use this interpolation method:

1  
2  
3  
4  
private float Lerp(float start, float stop, float alpha)
{
   return (1 - alpha) * start + alpha * stop;
}


Which works on normalized values. I think. Kinda forget, but looking at it makes me think that.
You could also use other easing methods. I suggest you look at LibGDX's Interpolation class code (it's on github).
27  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-03-17 04:37:54
Took another crack at battlefield, got an internal hack working in C++. Basically I wrote a program to inject a DLL I wrote into the memory address space of the game, so with the proper SDK offsets I could literally access the stuff like I was programming from the real source. Very fun. I can even call virtuals! I got engine debug rendering working, but then decided to simply hook into directx instead because it suited my needs.
28  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-03-16 22:00:25
You had to normalize it because it was a directional vector. I think. Directional vectors' length must always be one. Right? Yeah..?
29  Game Development / Newbie & Debugging Questions / Re: Matrix Transformations on: 2015-03-16 20:26:39
Just something quick because I have to go, but I was fairly sure you had to multiply trans * rot * scale to get the final transform. Order matters in matrix multiplication. I'm not the best with this stuff, but I gotta run.
30  Game Development / Newbie & Debugging Questions / Re: Going to build 2.5d Game on Facebook by JavaFX , your advice? on: 2015-03-16 06:32:22
LibGDX can export to HTML5 I believe
Pages: [1] 2 3 ... 29
 
Riven (21 views)
2015-04-16 10:48:47

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

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

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

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

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

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

ags1 (49 views)
2015-04-02 10:58:48

Riven (49 views)
2015-04-01 18:27:05

ags1 (66 views)
2015-03-31 10:55:12
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!