Gravity Arena (More Creative Name Pending)

Actually, i dont know what i can do for you guys. cheers. :slight_smile:

@t0neg0d said:
The videos are using the deform as a post processing filter... meaning that it is being applied to the end texture (everything). However, creating a post process filter or scene processor forcing this shader to do what you are looking for is really a no brainer. Basically what I am getting at is: Writing the filter/scene processor to separate out the objects to apply the effect to is the easy part. No matter which route you go, you'll need a shader that can actually deform the objects or textures. How you apply it is up to you, but the effect your looking for is easily achievable using this shader.


Okay so I am still worried about distribution, but I can't worry about that all day every day.

Here's what people who tried the demo commented on (aside from the ones it didn't work for): It didn't look like things were moving!

As such I think I should work on some effects now. Plus I need effects to make the other ships look good, and to make the gravity well casting spell (which is supposed to let you aim your little bullets in creative ways, along with pulling your enemy towards it as well) look good.

So I use your deform shader and apply it to the texture applied to the screen, and I use something else on the area I on the screen I want deformed?
This area, could I make it a geometry with your shader or is that not how it works?

I don't really understand much about shaders yet, most of my 3d knowledge was gotten on OpenGL before shaders.

I'm gonna read everything on your GPU Animation Factory post and see if I can learn anything.

EDIT: So the grey rocky looking one at the top... was that the ripple effect? That with modified frequency and amplitude is probably what I want to use, with maybe a lighting effect to add a hint of eldrich color to it or something.

Is this compatible with the parts of ShaderBlow with tunable glow effects? Because I want tunable glow effects for my game as well. When things get hit with heat eventually they will do black body radiation :D

Oooh... I guess a shader for that would be awesome, it would make the glow intensity always be reducing unless you set it up high and you could have weapon impacts with heat damage increase the intensity and color on part of the glowmap. That would be pretty cool. I really have to read up on writing shaders.
@mifth said:
WOW! Nice todo things!

I almost finished refraction post effect. It's based on JME simplewater. But i'll add some features too.

http://www.youtube.com/watch?v=EAUKCU5GRmc&feature=plcp



i'm still not good in plugins. :( Also, shaderblow has additional Models amd Textures which should be removed for the plugin.
assets/Models and assets/Textures folders...


Wow this refraction effect looks pretty good for what I need also. I wonder if that one is tunable.

@t0neg0d How about lightning? I was thinking make a line of points to the target and random walk the points (except the beginning and the end) and then in a very short time period blast some glowy particles down the line, or make a geometry around that object (since I use cross sectional procedural generation for everything, that's really easy for me) and then make the texture have a glow map that adjusts the glow from bottom (start point) to top (end point). That would be for a regular bolt, I guess, and to make one with little splits, I'd do another layer on top of that one with a start point at one of the random walk points, and then throw in another end point and random walk to that one.

Any suggestions?

I guess I'll need to make a lightning demo for people to understand what I'm talking about hehehe.

Lemme see if I can answer all of this :slight_smile:



I’m a big fan of “pretties”… anything that looks cool gets my vote.



So… first thing to keep in mind about shaders is (at least for JME… atm) you have access to a vertex shader (this determines vertex positions–in most cases this doesn’t change them… just calculates/converts them based on which view matrix you specify) and a fragment shader which applies colors/textures to the fragments between vertexes.



The shaders being used are specified by the material (in the material definition file) and materials are applied to geometries. The only reason it seems like you can apply them to a fullscreen rendering is because the rendered frame buffer is passed to another shader and rendered to a full screen quad.



Basically… what all that crap means is (and I’m not saying this because I don’t think you know this… just so we are on the same page when referring to different techniques for producing effects), you can either:



a) apply the effect to a specific geometry that will be effected no matter what other conditions are applied to the scene (this is just by specifying the geometries material)

b) apply the effect to multiple geometries by forcing a render texture to a geometry list using a scene processor. This is usually used for things like producing normals maps, depth maps, shadow maps, projective texturing, etc.

c) apply the effect to the entire scene using a post process filter. Note… you can limit what you apply this to based on how you write the shader… but that’s sorta beyond what we’re talking about atm.



So… ways of producing the gravity effect. Couple more questions to help you pick the right approach (basically… when I say look at using the GPUAnimationFactory shaders… I mean either as is… or strip out the code you need for your own shaders. I intentionally left them as standalone shaders so they could be repurposed… though, the shaders are set up to do any of these).


  1. Does it need to effect object behind the effect? or only those “inside the effect”. If behind it as well… a post process filter is your choice (or this in combo with geometry materials)… however this will be a bit more difficult, you’ll need to evaluate the scene via a depth map, which means dipping into Passes at the same time as learning the basics of post process filtering. Otherwise… applying the effect to geometries would be more appropriate.



    Actually… a little more about this approach:



    You’ll need the rendered screen un-effected, the depth map + screen coords of the effected area and you’ll need to produce the effected area out of this and then overlay it back onto the screen render.


  2. Does the effect your thinking of produce a visual that would be visible say on a black background? Or does it just distort the objects in or behind it? Is it produces a visual all on it’s own, you’ll need to account for that with (more than likely) a geometry to render that portion of the effect on to.



    Anyways… lemme know about these.



    As for the question about the ripple effect… yes… the grey colored box shows one variation of the texture deform ripple, the teapot below it shows one variation of the mesh deform ripple applied to a single axis. These can be compounded… like ripple + wave+ warp + rotation + movement for texture. Can do the same thing for mesh deforms… except you can compound them for each axis… in combination with texture + opacity, you can produce just about any effect you can think of.



    As for combining this with other effects, yes and no. It works with almost everything EXCEPT self-shadowing, because shadow casting is produced on the CPU… this shader does everything on the GPU… JME is not actually aware of the updates to the mesh (until we get access to transform feedback… then I’ll update it). Glow is a post effect, so it is applied to the final render and will work.



    But… all that said… the refraction post effect may be the way to go!
1 Like

I am generally not interested in shadows for the games I am working on, UNLESS there is some way of making a negative light, which I think really should be added to OpenGL (though I think it isn’t). I really don’t think it would be difficult to have a light do everything it is supposed to do, but instead of adding to an object, subtracting from it. I think that would be great, and when used in spotlight form, it could kind of make an interesting shadow effect.



Anyway, so I think having a geometry represent where the effect is happening makes the most sense. The reason I thought that video with the refraction effect was so cool, was it seemed to be doing just that. There was a cube, and everything inside the cube was rippled, and everything outside was not. That’s exactly what I need, though of course tuned for what I’m doing.



As for black background etc, ideally yes I would like it to be partially visible on a black background, so if you imagine rippled glass, but with a hint of some lighting. Would it be difficult to see rippled glass sitting on black velvet or crude oil? Kinda, but you could still see it.



Thanks for being so respectful about what I may or may not know. My ideas about this subject are vague, so everything you’re putting down is helpful.



In any case what I think I can take from what you wrote there, is that using a geometry with a special shader to have the effect is the best answer, because much like with transparency, I can allow some of the background/objects behind the geometry to get visibly warped because they are going through the warped geometry.



That seems like the simplest solution, if I read what you have correctly, especially as my expertise is producing geometries such as those my effects would be effecting. I’m a turn a few equations into a teapot kind of guy, so putting a cone or sphere with a ripple effect is easy.

@yuxemporos said:
Wow this refraction effect looks pretty good for what I need also. I wonder if that one is tunable.



Sources are here:
http://code.google.com/p/jmonkeyplatform-contributions/source/browse/#svn%2Ftrunk%2FShaderBlow

You will find your lighting looks bad/wrong unless you also include shadows (unless you are in a very specific non-shadowed environment, for example if you were set inside a computer or something similarly abstract)…

@zarch said:
You will find your lighting looks bad/wrong unless you also include shadows (unless you are in a very specific non-shadowed environment, for example if you were set inside a computer or something similarly abstract)...


Well, since it is a space game, it is a lot harder to make sensible shadows. There's no ground, for instance, and the light is generally going to be a star in the center of the arena. As there's no ground, and no directional light, it isn't really a "let's drop a dark circle here and call it a day" situation.
@mifth said:
Sources are here:
http://code.google.com/p/jmonkeyplatform-contributions/source/browse/#svn%2Ftrunk%2FShaderBlow


I've been examining an older version of shaderblow, which is apparently using invalid code, because when I tried to run it, it said there's no longer a fixedfunc keyword or whatever. I'm downloading the version you just posted and I'll see if I can get any groovy effects with it.

EDIT: I started looking at the version of shaderblow you sent me to. There is a demo of a refraction filter there, but it affects the whole screen. How do I make it only affect a cube/other-geometry like in that video you posted?

Do you have any good ideas for lightning?

Here's my current idea:
I was thinking make a line of points to the target and random walk the points (except the beginning and the end) and then in a very short time period blast some glowy particles down the line, or make a geometry around that object (since I use cross sectional procedural generation for everything, that’s really easy for me) and then make the texture have a glow map that adjusts the glow from bottom (start point) to top (end point). That would be for a regular bolt, I guess, and to make one with little splits, I’d do another layer on top of that one with a start point at one of the random walk points, and then throw in another end point and random walk to that one.
@yuxemporos said:
I've been examining an older version of shaderblow, which is apparently using invalid code, because when I tried to run it, it said there's no longer a fixedfunc keyword or whatever. I'm downloading the version you just posted and I'll see if I can get any groovy effects with it.

EDIT: I started looking at the version of shaderblow you sent me to. There is a demo of a refraction filter there, but it affects the whole screen. How do I make it only affect a cube/other-geometry like in that video you posted?

Do you have any good ideas for lightning?



Fixed Func was removed from nightlies.

There are 2 refraction effects:
postProcessor - http://code.google.com/p/jmonkeyplatform-contributions/source/browse/#svn%2Ftrunk%2FShaderBlow%2Ftest-src%2Fcom%2Fshaderblow%2Ftest%2Fsimplerefraction

filter - http://code.google.com/p/jmonkeyplatform-contributions/source/browse/#svn%2Ftrunk%2FShaderBlow%2Ftest-src%2Fcom%2Fshaderblow%2Ftest%2Ffilter%2Fsimplerefractionfilter

What do you want about lighting?
1 Like
@mifth said:
Fixed Func was removed from nightlies.

There are 2 refraction effects:
postProcessor - http://code.google.com/p/jmonkeyplatform-contributions/source/browse/#svn%2Ftrunk%2FShaderBlow%2Ftest-src%2Fcom%2Fshaderblow%2Ftest%2Fsimplerefraction

filter - http://code.google.com/p/jmonkeyplatform-contributions/source/browse/#svn%2Ftrunk%2FShaderBlow%2Ftest-src%2Fcom%2Fshaderblow%2Ftest%2Ffilter%2Fsimplerefractionfilter

What do you want about lighting?



OH I only noticed the refraction filter test, not the other one. Hah.
Great, that looks like it has everything I need. I should have a good looking gravity warping material soon.


As for the lightning, what did you think of the idea I had. Can you visualize what I was describing? I think it might look good. It's probably worth me giving it a shot anyway, though I'll probably practice with the gravity refraction thing first.

Simplest way to do lightning would just be a billboard with a (mostly) transparent image on it and then a shader to animate the lightning on the image.

@zarch said:
Simplest way to do lightning would just be a billboard with a (mostly) transparent image on it and then a shader to animate the lightning on the image.


Unless there's already some sweet lightning texture generator out there for jmonkey, I think I'd be much more comfortable making it 3d. Especially as I'd want it to be different every shot of the lightning.

Today I experimented with sound, and eventually got it to work.



So, now there is a sound effect when you use the thrusters! Woo.



I also got some other graphics reworked so I have another ship that is semi-operational. Sadly it does more to show off my bugs, so I’m not really demonstrating it at this time.



I am still having some trouble figuring out exactly how to incorporate the refraction effect for gravity warping with the rest of my game, so I’m still working on that. Another issue with that is I am not sure how I want to make it work. Do I want a “wake” effect where I drop little shrinking refracting geometries, or do I want to just attach a shape to the engine, and if so, what shape? A cone? An ellipsoid? Also if I use the wake, what kind of geometry should I drop?

1 Like

I added my first attempt at a space time warping wake. It looks terrible, but it’s a start.



It’s done with a particle emitter currently.



Other approaches I may try:

  1. a static shape of warp around and behind the engine
  2. refreshing a stack of points the engine passes through and have the wake be a shape that gets updated based on those points
  3. dropping spheres behind the engine in a similar way to a particle effect except not using ugly squares.
1 Like

Cool, I dont suppose you need any custom models? I guess Sci-fi is my speciality but I dont realy have any use for it with my game :stuck_out_tongue:



http://www.turbosquid.com/3d-models/blend-robot-sci-fi/695006



http://www.turbosquid.com/3d-models/alien-vessel-3d-obj/691766



http://www.turbosquid.com/3d-models/free-obj-model-spaceship-alien-futuristic/691570

(that last one has over 500 downloads, not even been on 2 months :D)



I’d be willing to do some free as long as I could put it on turbosquid later

1 Like
@javagame said:
Cool, I dont suppose you need any custom models? I guess Sci-fi is my speciality but I dont realy have any use for it with my game :p

http://www.turbosquid.com/3d-models/blend-robot-sci-fi/695006

http://www.turbosquid.com/3d-models/alien-vessel-3d-obj/691766

http://www.turbosquid.com/3d-models/free-obj-model-spaceship-alien-futuristic/691570
(that last one has over 500 downloads, not even been on 2 months :D)

I'd be willing to do some free as long as I could put it on turbosquid later


They look decent but I don't really want to incorporate models not generated in my procedural generation system in my game unless I figure out that it's really necessary. Thank you for the offer though!

I have other cool looking stuff already designed in my game, I just don't have the back-end system set up for them.

I am having trouble determining some of the things related to relative motion and stuff and I am kind of waiting till I work on some more graphical effects before I go back to working on physics (which I think will help me figure out the relative motion).

sounds awesome, good luck

Would love to see screen shots of progress as you go!

@t0neg0d said:
Would love to see screen shots of progress as you go!

Oh, well that's not really how this stuff works. Most of my art I made a while ago and I've just readjusted it for jmonkey.

Most of what I am doing now is learning, but all my updates are all interactive stuff, rather than graphics. As I don't feel like saving tons of versions of my game, you'll just have to try out the updates when they come out.

Later once I get the hang of things in Jmonkey I'll get back to making content and then I'll probably take pictures.

For instance I'll probably take some pictures once I get lightning working.