Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (532)
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 4
1  Discussions / General Discussions / Re: Passing vectors from Vertex to Fragment on: 2014-05-26 15:32:07
here is a bit of an example...
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
#version 410


uniform mat4    in_projectionMatrix;
uniform mat4    in_cameraMatrix;
uniform mat4    in_modelMatrix;
layout(location = 0) in vec3 vp;
layout(location = 1) in vec3 np;

out vec3 pass_normal;
out mat4 pass_cameraMatrix;

void main () {
    vec4 vertex = vec4(vp, 1.0);
    gl_Position =    in_projectionMatrix * in_cameraMatrix * in_modelMatrix * vertex;
    pass_normal = np;
    pass_cameraMatrix = in_cameraMatrix;
   
   
}



1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
#version 410

in  vec3 pass_normal;
in  mat4 pass_cameraMatrix;
out vec4 frag_colour;







void main(){
   //frag_colour = vec4(0.5, 0.0, 0.5, 1.0);
  vec4 colour = vec4(pass_normal, 1) * pass_cameraMatrix;
   //frag_colour = vec4(0.1,0.1,0.1,1) * colour;
  frag_colour = colour;
   
}
2  Java Game APIs & Engines / OpenGL Development / Re: Render on specific GPU in OpenGL on: 2014-03-07 16:50:48
To the original poster...

I'm guessing your on a Macbook Pro. Cause this two video card approach is exactly how they are setup.

So to answer your question and give you a hint to what your going to encounter next ..

1) you dont have to do anything .. as soon as you init your display using OpenGL it will switch to the dedicated card. There is a GLX util you can download that monitors the cards and will show you it autoswitches.

2) now the next challenge.. which version of opengl do you want to use? By default the dedicated card will be a opengl 2.2 profile. If you want the opengl 4.1 profile you will have to specifically init the opengl profile asking for ... 3.2 CORE ... (yes 3.2 CORE = 4.1 implementation.. if you ask for 4.1 you will get an error.. welcome to the nuances that is Mac gaming Smiley

3  Discussions / General Discussions / Re: Windows 8 Purchase on Linux on: 2014-03-05 16:15:31
Here is how you do it.

Install the software.. when it asks for you to enter your key.. dont.
it will allow the install to continue... but it will not be a "registered" install.
then once installed.. you install it again using the same disk.
This time you can use your key and all will turn out fine.

I've often used upgrade disks.. this is the work around.
4  Game Development / Newbie & Debugging Questions / Re: Why should I use a Game-Engine like lwjgl or libgdx instead of Swing? on: 2014-03-05 15:56:12
For 2D games there are lots of options.. the only real answer is use what works for you.

When talking about lwjgl and libgdx the real trade off is they are wrappers exposing opengl to your java code. If your game will not benefit from opengl then there may not be a compelling reason to use these. On the other had these are both libraries suited to game development and opengl will provide high performance graphics, but they will be harder to work with then pure swing for very basic tasks like making buttons.
5  Game Development / Newbie & Debugging Questions / Re: New to java, where do i start? on: 2014-03-04 20:35:44
If you are new to java I recommend you download the the book "Thinking in Java" by Bruce Eckle. You can download it for free. Its a great book and introduces the concepts used in java programming in one of the most logical ways I've ever seen.

j.
6  Discussions / General Discussions / Modern Opengl (4.x) unproject on: 2014-02-16 19:10:00
Ok.. so my old code used GLU unproject to transform mouse coords into world coords.

Now that i have converted to OpenGL 4.x i have run into an issue.

The param used to call unproject include the viewport matrix. I used to get this by asking opengl to return it to me.
Now it seems i will have to create the matrix my self before calling the function.

anyone ever found any documentation on how to convert your width / height into a view port matrix?

thanks
j.
7  Game Development / Game Play & Game Design / Re: How does one make such perfect 8x8 font? on: 2014-02-13 17:37:07
not sure im following your question..

what he did was make an image map. each region becomes a letter.
the regions in the image are evenly spaced so its easy to iterate through them.

the actual act of making the letters is just a matter of drawing them in your favourite paint program.

8  Discussions / General Discussions / Re: Indie Crowdfunding on: 2014-02-13 17:11:41
crowdsourcing is basically like pre-buying a game a your local best buy.
you pay up front with no product only a promise that eventually youll get it.

Which likely explains why most donators are actually paying the minimum price to get the product and not token 1$ amounts.

This method is great for indie start ups that want to try something the community believes in but a large publisher would not risk money on.

I just worry that the percentage of games that never get delivered may tarnish this medium.

j.
 
9  Discussions / General Discussions / Re: Data bases and game programming on: 2014-02-13 17:07:13
JavaDB / Derby is good option if you want a DB for game development. Mostly cause it has a in memory only runtime mode. So the latency of hiting and reading from the DB is basically removed in this model.

j.
10  Discussions / General Discussions / Re: Modern (opengl 4.x) Mesh Animation Techniques? on: 2014-02-13 17:05:31
 theagentd / quew8 - thanks for the amazing info. I have lots to research now !
this is exactly the sort of tip i was hoping for.

j.
11  Discussions / General Discussions / Modern (opengl 4.x) Mesh Animation Techniques? on: 2014-02-12 21:19:40
Can anyone provide any guidance on modern day techniques for supporting mesh animations?
I've read lots of summaries of different techniques.. but the date stamps on the write ups and the underlying approach imply they are likely for legacy GL approaches.

thanks
j.
12  Discussions / Business and Project Management Discussions / Re: [$300-$1000] [LWJGL] Need experienced GLSL programmer on: 2014-02-11 21:57:07
buy the pdf book the shader cookbook.
it covers exactly what your asking for and runs about 20$.

im working my way through it right now.

j.
13  Discussions / General Discussions / Re: New feature: coding experience on: 2014-02-06 15:58:55
Love the new fields.. I think we should add one more.. years of OpenGL experience.
As a long term java coder i was completely new to OpenGL when i started playing in the game space...

14  Discussions / General Discussions / Re: LWJGL Context and Mac OSX Mavericks on: 2014-01-30 18:46:47
solution found.. but man this is weird!

ok.. here goes

if you want to support a mac you MUST EXPLICITLY select version 3.2 CORE
.. oh wait you say.. but i thought opengl version 4.1 is the highest it supports..

Well your right.. and guess what.. when you pick 3.2 it will give you a 4.1 implementation in return

this is verifiable by using glGetString(GL_Version) ..  so .. the real way to find out what version you have access to on a mac is to first select 3.2 then test the string value to see what you really get. (face palm..#1)

now if you actually try to request a GL Context using 4 as the major and 1 as the minor.. DING.. you get version 2.1 .. you MUST use 3.2.

and now for those that have put up with my rant.. some useful code Smiley

1  
2  
3  
PixelFormat pixelFormat = new PixelFormat();
ContextAttribs attribs = new ContextAttribs(3,2).withProfileCore(true);
Display.create(pixelFormat, attribs);
15  Discussions / General Discussions / LWJGL Context and Mac OSX Mavericks on: 2014-01-30 18:26:53
So new lesson for me today.

Mac computers unlike everyone else.. default their openGL implementation to 2.1 unless you specifically set your OpenGL profile exactly right.. (current mavericks support is actually for opengl 4.1)

So now im struggling to get my settings perfectly right so that the video card actually switches to OpenGL 4.1 mode.

anyone got any experience with this?
sample code would be a blessing Smiley

thanks
j.
16  Discussions / General Discussions / Re: suggestions on using keytool with selfsign on: 2014-01-23 22:26:22
using keytool you can make a new self signed certificate.

just keep in mind that while you will add this cert to your keystore...it will not exist in other peoples key stores..

so they will get a nasty error message when trying to use your game.

j.
17  Discussions / General Discussions / Re: Considering Java for game development, looking for brains to pick on: 2014-01-21 05:28:03
here is an interesting though..

With the updates to OpenGL. Specifically the increased use of Shaders. The language you write you game in could be argued to be less a factor than it use to be. Java is equally fast as C / C++ with some exceptions in C/C++'s favour and some in Java's. The decision for most of us to butt the C/C++ trend and use Java is either due to our familiarity with the language or our love of how clean the language is in comparison to the others.

j.
18  Game Development / Newbie & Debugging Questions / Re: How to get the bullets to go towards mouse? on: 2014-01-20 18:53:35
doh your totally right!

awt / swing
19  Game Development / Newbie & Debugging Questions / Re: How to get the bullets to go towards mouse? on: 2014-01-20 18:25:22
ok.. so your starting your bullet where your player is..

what i dont see in your code is any logic to determine where the mouse is.

I believe the code your looking for is in the input section of the LWJGL wiki web site. (assuming thats what your using)

[udpate]

actually let me take that back .. your draw method makes me think you may be using a version of JOGL .. in which case you need to use standard java mouse listener to get the x /y of the mouse.



j.
20  Discussions / General Discussions / Re: Error Handeling on: 2014-01-12 21:54:26
Let me attempt to be more clear.

Its the old bubble up debate.

When you encounter JAVA exception that need to be handled in your code. ( which hopefully you wont have too many instance of )
Do you

A) wrap a try catch block around it and do you best to handle / hide the errors if any occur

or

b) let them bubble up and just have a high level try catch handle them since in just about every case if an error happens in a game we are not going to try to handle them gracefully but rather show an error and end the game.

21  Discussions / General Discussions / Error Handeling on: 2014-01-12 21:05:18
Normally i'm very diligent in my error handeling.. but this is because most of my coding is done in the business world where errors often result in situations where life pretty much continues and retrying is occasionally a valid approach... or if not possible someone needs to know how to solve the error right now.

so now my question..

im finding that most of the errors that i may have to account for my game coding are in fact show stoppers. Cant load my texture file.. or my shader.. ya.. then i really dont think we should continue. Lets stop here tell you about the problem and call it quits.

but if this is truely the case then i could just let these bubble up and handle then at my game engine layer as one catch, show error and end game.


how do you handle errors?

j.
22  Discussions / General Discussions / Re: Dealing with billboards and Z buffers on: 2014-01-10 21:44:31
i think you got the answer..

In my 3D engine i have two stages of drawing. I do my 3D models first then i switch to 2D elements to do my HUD. effectively you can do the same thing here.

Note: doing this i do remove the depth testing. This would work well if your 2d figure was always going to be the same distance from the camera looking at him. otherwise you may still want to treat your char. as a 2D element in the 3d world.
23  Discussions / General Discussions / Re: Need code examples on: 2014-01-10 21:41:17
is this for a work project or personal one.

While i would happily help out personal endeavours that are targeting a profit.. I feel reluctant to just donate my time and experience to a corporation without compensation. I would also expect that a game company would have a certain level of expertise and would not be looking for such examples if they were already established.



24  Game Development / Newbie & Debugging Questions / Re: Saving and Loading on: 2014-01-10 17:58:15
The problem is likely one of the following

An order of events issue.
or
A scope issue (scope as in what variables can be referenced and from where)

Your drawing works..  you showed this by drawing the buildings initially.
But your loading doesnt.. so what is different in these flows?

All of this i am summarizing based on your description of the problem not your code.

j.
25  Discussions / General Discussions / Re: One of the best talkers I have ever heard. on: 2014-01-10 17:52:11
he has a TED talk that is also really good.

26  Discussions / General Discussions / Scripted Events on: 2014-01-09 15:17:20
I would like to the community for input:

I'm wonder on what are good techniques for scripting events in a game.
So far my game has a lot of user interaction and triggered events. These have been fairly straight forward to implement.
Alternatively if i want to have a 30 second cut scene thats is "relatively" pre determined, how best to implement that?

So far i have tried coding the event with a series of method calls to manipulate the models and timers to create the delays between them.
This approach just feels a bit clunky.. but it works.

I look forward to seeing the communities suggestions.

thanks
j.
27  Discussions / General Discussions / Re: RayCasting Explained - source samples included on: 2014-01-09 01:56:24
updated the paste bin with new sample code.

new code adjusts for model rotation and normal correction in the math calculation.

28  Discussions / Miscellaneous Topics / Re: What will be the next hype after zombies? on: 2014-01-07 17:48:53
dare you to skin one of your robot games to be based on zombies Smiley

In a future world .. the zombies returned.. Attack of the Z.

(just being cheeky)
j.
29  Discussions / General Discussions / Re: RayCasting Explained - source samples included on: 2014-01-07 17:15:41
[Update]

I finally got the full functionality of my raycast util working last night.

Expect an updated video and sample code later this evening.

j.
30  Game Development / Newbie & Debugging Questions / Re: [QUICK QUESTION] Random numbers and outcomes on: 2014-01-07 17:14:14
nextInt(int n)
          Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.

-Taken from the javadoc

j.
Pages: [1] 2 3 4
 

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

The first screenshot will be displayed as a thumbnail.

pw (14 views)
2014-07-24 01:59:36

Riven (14 views)
2014-07-23 21:16:32

Riven (13 views)
2014-07-23 21:07:15

Riven (15 views)
2014-07-23 20:56:16

ctomni231 (43 views)
2014-07-18 06:55:21

Zero Volt (40 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (36 views)
2014-07-16 23:30:00

Cero (50 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!