Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (753)
Games in Android Showcase (228)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 ... 100 101 [102] 103 104 ... 199
  ignore  |  Print  
  What I did today  (Read 2481166 times)
0 Members and 2 Guests are viewing this topic.
Offline BCoding

Junior Devvie


Medals: 4
Exp: 4 years



« Reply #3030 - Posted 2015-10-11 03:07:37 »

*
Cool it's looking good man. Smiley Also I noticed the very top beam seems to be getting condensed at the top of the image, as if it's reflecting off of something - intended?

WoW, music, and programming. Life is good.
Offline kingroka123
« Reply #3031 - Posted 2015-10-11 03:23:20 »

that is just how the light went through that crack. It wasnt intended but that just gave me a fascinating idea  Cheesy
Offline Roquen

JGO Kernel


Medals: 517



« Reply #3032 - Posted 2015-10-11 14:41:12 »

Whatever you think about Apple.  Still total risk takers.   They're pushing for total vertical integration: http://adriansampson.net/blog/appleisa.html
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online SHC
« Reply #3033 - Posted 2015-10-11 18:11:01 »

Found a new way to use generics in Java for solving a problem with WebGL, having a function return data in different types depending on a parameter name. This is possible in JS with duck typing, but generics allowed that in Java too with Java 7.

For example: This is the code I wrote using generics for the glGetParameter() method in WebGL10 class. This does convert the objects into integers as they are represented as integers in desktop OpenGL (chosen to look like LWJGL classes since it makes it easy for me to port to WebGL in the end).

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  
@SuppressWarnings("unchecked")
public static <T> T glGetParameter(int pname)
{
    checkContextCompatibility();
    T result = nglGetParameter(pname);

    switch (pname)
    {
        case GL_ARRAY_BUFFER_BINDING:
        case GL_ELEMENT_ARRAY_BUFFER_BINDING:
            return (T) (Integer) WebGLObjectMap.get().createBuffer((JavaScriptObject) result);

        case GL_CURRENT_PROGRAM:
            return (T) (Integer) WebGLObjectMap.get().createProgram((JavaScriptObject) result);

        case GL_FRAMEBUFFER_BINDING:
            return (T) (Integer) WebGLObjectMap.get().createFramebuffer((JavaScriptObject) result);

        case GL_RENDERBUFFER_BINDING:
            return (T) (Integer) WebGLObjectMap.get().createRenderBuffer((JavaScriptObject) result);

        case GL_TEXTURE_BINDING_2D:
        case GL_TEXTURE_BINDING_CUBE_MAP:
            return (T) (Integer) WebGLObjectMap.get().createTexture((JavaScriptObject) result);
    }

    return result;
}

The above allows one to use it to take multiple parameters, as like in this example.

1  
2  
3  
int          texture    = glGetParameter(GL_TEXTURE_BINDING_2D);
boolean      blending   = glGetParameter(GL_BLEND);
Float32Array blendColor = glGetParameter(GL_BLEND_COLOR);


This is similar to how people use WebGL from the native JavaScript too, where the var keyword is used instead of the return types. Interested, I thought how this will be output in JS by the GWT compiler. This is the version without optimisations in SuperDev mode.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
function glGetParameter_0_g$(pname_0_g$){
  $clinit_WebGL10_0_g$();
  var result_0_g$;
  checkContextCompatibility_0_g$();
  result_0_g$ = nglGetParameter_0_g$(pname_0_g$);
  switch (pname_0_g$) {
    case 34964:
    case 34965:
      return dynamicCastAllowJso_0_g$(dynamicCast_0_g$(valueOf_60_g$(get_40_g$().createBuffer_1_g$(dynamicCastJso_0_g$(result_0_g$))), 1480), 1);
    case 35725:
      return dynamicCastAllowJso_0_g$(dynamicCast_0_g$(valueOf_60_g$(get_40_g$().createProgram_1_g$(dynamicCastJso_0_g$(result_0_g$))), 1480), 1);
    case 36006:
      return dynamicCastAllowJso_0_g$(dynamicCast_0_g$(valueOf_60_g$(get_40_g$().createFramebuffer_1_g$(dynamicCastJso_0_g$(result_0_g$))), 1480), 1);
    case 36007:
      return dynamicCastAllowJso_0_g$(dynamicCast_0_g$(valueOf_60_g$(get_40_g$().createRenderBuffer_1_g$(dynamicCastJso_0_g$(result_0_g$))), 1480), 1);
    case 32873:
    case 34068:
      return dynamicCastAllowJso_0_g$(dynamicCast_0_g$(valueOf_60_g$(get_40_g$().createTexture_1_g$(dynamicCastJso_0_g$(result_0_g$))), 1480), 1);
  }
  return result_0_g$;
}

It is almost the same, but the call to nglGetParameter, a method that is written using JSNI is still not inlined. So I thought verifying the optimised output of the method and setting the compile style to pretty for this input:

1  
2  
int result = glGetParameter(GL_TEXTURE_BINDING_2D);
GWT.log("" + result);

It inlined the code perfectly, even from the parameter it judged what type I was trying to create and inlined the casts as well, producing the following version:

1  
2  
3  
checkContextCompatibility();
result = $wnd.gl.getParameter(32873);
valueOf($createTexture(get_2(), dynamicCastJso(result)));

The piece where $wnd.gl.getParameter is actually part of nglGetParameter method which is the JSNI method, and it got inlined into the glGetParameter method, which itself is inlined into the onModuleLoad method which is the entry point. This is extremely good, I was initially worried about the overhead my library introduces, but it turned out that there is no overhead actually!

It started with the question on how to write the Java function for the IDL
any getParameter(GLenum pname)
that made me look into generics, and took me to verify the contents of the generated JS by the compiler. Learnt this today.

Offline ra4king

JGO Kernel


Medals: 507
Projects: 3
Exp: 5 years


I'm the King!


« Reply #3034 - Posted 2015-10-11 18:29:57 »

Whatever you think about Apple.  Still total risk takers.   They're pushing for total vertical integration: http://adriansampson.net/blog/appleisa.html
Wow, I didn't even know they had their own microarchitecture! That's incredible...

Offline Roquen

JGO Kernel


Medals: 517



« Reply #3035 - Posted 2015-10-11 21:03:09 »

Whatever you think about Apple.  Still total risk takers.   They're pushing for total vertical integration: http://adriansampson.net/blog/appleisa.html
Wow, I didn't even know they had their own microarchitecture! That's incredible...
http://www.anandtech.com/show/7910/apples-cyclone-microarchitecture-detailed
Offline Brynn

JGO Wizard


Medals: 103
Projects: 3
Exp: 1 month or less


JGO's Spiffy Duchess


« Reply #3036 - Posted 2015-10-13 01:21:21 »

I got backing from my parents to switch my hosting providers. I got this new domain and I spent a few hours setting up a virtual machine, installing apache, and getting a webserver (im now using google cloud compute as my host) http://imakegames.xyz

Welcome to a new kind of tension
All across the alienation
Where everything isn't meant to be okay
Offline Roquen

JGO Kernel


Medals: 517



« Reply #3037 - Posted 2015-10-13 12:40:49 »

Ha ha, HA Ha....ha ha ha.  Rediscovered Java's rules for converting a float into an integer. 
 i = (int)f; 
  I wondered why some of my code with littered with tests & branches.
Offline princec

« JGO Spiffy Duke »


Medals: 1012
Projects: 3
Exp: 20 years


Eh? Who? What? ... Me?


« Reply #3038 - Posted 2015-10-13 12:56:11 »

Ha ha, HA Ha....ha ha ha.  Rediscovered Java's rules for converting a float into an integer. 
 i = (int)f; 
  I wondered why some of my code with littered with tests & branches.

Wot's so funny about the rules?

Cas Smiley

Offline Roquen

JGO Kernel


Medals: 517



« Reply #3039 - Posted 2015-10-13 13:50:22 »

Nothing...other than I forgot them.  Notably if 'f' is too big to fit the result is the largest int.  Intel hardware doesn't do that with their opcode so the JVM has to compare to be able to do the fix-up in hedge cases.  I forgot the rule and was driving myself nuts trying to figure out what was causing the compares & branches.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

« JGO Spiffy Duke »


Medals: 1012
Projects: 3
Exp: 20 years


Eh? Who? What? ... Me?


« Reply #3040 - Posted 2015-10-13 15:24:33 »

Arrgh, seriously? So every time I'm casting to an int the JVM can't use an intrinsic and has to branch???

Cas Smiley

Offline ra4king

JGO Kernel


Medals: 507
Projects: 3
Exp: 5 years


I'm the King!


« Reply #3041 - Posted 2015-10-13 16:13:18 »

Not really today... yesterday I biked 100 miles/160 km with some friends! Longest bike ride of my life but I enjoyed it.

Offline Riven
Administrator

« JGO Overlord »


Medals: 1336
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #3042 - Posted 2015-10-13 17:54:19 »

Not really today... yesterday I biked 100 miles/160 km with some friends! Longest bike ride of my life but I enjoyed it.

Nice. avg speed?

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline Roquen

JGO Kernel


Medals: 517



« Reply #3043 - Posted 2015-10-13 19:17:24 »

Arrgh, seriously? So every time I'm casting to an int the JVM can't use an intrinsic and has to branch???

Cas Smiley

Yeap.  That's why I was having one of those "Somebody just poked me in the eye with a sharp stick" moment.


0x00000000029cc0f3: cvttss2si r11d,xmm2      ; this is the cast to int
0x00000000029cc0f8: cmp r11d,0x80000000      ; compare against the value returned for overflow
0x00000000029cc0ff: jne L0000                ; continue normally - this sucks if this is cold...prediction will guess fall-through..wrong!
0x00000000029cc101: sub rsp,0x8              ; from here to the label is do it the hard way via some function
0x00000000029cc105: movss dword ptr
0x00000000029cc10a: call
0x00000000029cc10f: pop r11
             L0000:               ; code past the cast


I was naively expecting the one opcode.
Offline thedanisaur

JGO Knight


Medals: 59



« Reply #3044 - Posted 2015-10-13 19:30:57 »

I don't think Java has a trunc method so how do we get around this? BigDecimal might work, I think you can set the scale to zero, but that doesn't seem like the right way to handle it.

Every village needs an idiot Cool
Offline ra4king

JGO Kernel


Medals: 507
Projects: 3
Exp: 5 years


I'm the King!


« Reply #3045 - Posted 2015-10-13 19:33:56 »

Not really today... yesterday I biked 100 miles/160 km with some friends! Longest bike ride of my life but I enjoyed it.

Nice. avg speed?
The average was 12.5-15 mph/20-24 km/h, but on the flat stretches I was going upwards of 18-19 mph/30 km/h!

Offline Roquen

JGO Kernel


Medals: 517



« Reply #3046 - Posted 2015-10-13 20:58:53 »

so how do we get around this?
You don't worry about it.  When the code is hot (getting called a lot in a short time) then it isn't costing you much.  Probably less than one CPU cycle.  If the place where the conversion is happening is cold most of the time...then it probably doesn't amount to much wastage in total.
Offline NegativeZero

JGO Kernel


Medals: 329
Exp: 1 month or less


Zero but not.


« Reply #3047 - Posted 2015-10-14 08:51:10 »



- DOWNLOAD -
DESKTOP | ANDROID

Recently I've scaled back and just tried to finish a project (namely the one pictured above), however I've struggled to make what I'm working on very compelling or fun.
I'm going to try focus on school for the final month of the school year leading up to exams, then I'll work on something new afterwards.

Premise of the game:
Collect the balls with your paddle (controlled by mouse or A/D)
As you missthe balls, your paddle gets smaller. When you have no more paddle left, you lose.

Offline orange451

JGO Kernel


Medals: 358
Projects: 6
Exp: 6 years


Your face? Your ass? What's the difference?


« Reply #3048 - Posted 2015-10-14 17:29:57 »

I made a deferred renderer with my HBAO shader in lwjgl3 today Smiley



First Recon. A java made online first person shooter!
Offline ags1

JGO Kernel


Medals: 363
Projects: 7


Make code not war!


« Reply #3049 - Posted 2015-10-14 20:40:08 »

Started on generating paths between settlements in my game. There are some shortcomings in the logic (the paths for the purple nation are very suboptimal Smiley ) and I don't know how to generate paths through the neutral (white) areas.



...also learned that my game might be classified as pseudoroguelike.

Offline Brynn

JGO Wizard


Medals: 103
Projects: 3
Exp: 1 month or less


JGO's Spiffy Duchess


« Reply #3050 - Posted 2015-10-14 21:48:16 »

I have done a lot of things over the past month, including starting (and switching) schools. I will make a few posts when I feel ready to later. However I switched to Google Compute Engine and made a new domain; the dry wit in my code is still there though: http://imakegames.xyz/this-doesnt-exist

Welcome to a new kind of tension
All across the alienation
Where everything isn't meant to be okay
Offline VaTTeRGeR
« Reply #3051 - Posted 2015-10-14 21:55:07 »

@ags1: here's relatively simple algorithm to find minimum-spanning-trees:
https://en.wikipedia.org/wiki/Kruskal%27s_algorithm Pointing
Offline ags1

JGO Kernel


Medals: 363
Projects: 7


Make code not war!


« Reply #3052 - Posted 2015-10-14 22:33:21 »

My current approach is to start with the capital, and add a path to the nearest village; then add the next village nearest to the two connected villages and so on. It means all villages have a path back to the capital.

I need to "denormalize" this somewhat, so that nearby villages have shortcuts. For example, the paths for my purple nation are OK, but there should be a shortcut path closing the ring. I could either do this by simple proximity (all villages with 1.5km of each other get a connecting path) or I can add paths where the new path reduces the total distance from all villages to the capital. The first idea would not fix the purple nation, but the second would. Maybe I should do both...

Offline orange451

JGO Kernel


Medals: 358
Projects: 6
Exp: 6 years


Your face? Your ass? What's the difference?


« Reply #3053 - Posted 2015-10-15 03:08:05 »

Working on material types Smiley



Does anyone know about PBR using HDR textures?

First Recon. A java made online first person shooter!
Offline Brynn

JGO Wizard


Medals: 103
Projects: 3
Exp: 1 month or less


JGO's Spiffy Duchess


« Reply #3054 - Posted 2015-10-15 20:30:39 »

Okay. So I worked on Tetradecagon, lost a few brackets for my braces.. what havent I done today?

incase you didnt notice http://www.java-gaming.org/topics/iconified/36768/view.html

Welcome to a new kind of tension
All across the alienation
Where everything isn't meant to be okay
Offline Longarmx
« Reply #3055 - Posted 2015-10-16 02:16:08 »

Created a (very rough) fractal generator. It can currently render the Mandlebrot set and all Julia sets at incremental zoom levels up (or down) to the precision of a double (I know, it's not good enough). It also has the ability to "record" a video zooming out from the current point.

* By record I mean that it renders images of the fractal at incremental zoom levels. The images are then exported to video with Windows Live Movie Maker.


full-scale

<a href="http://www.youtube.com/v/0SuBiFkYl1Q?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/0SuBiFkYl1Q?version=3&amp;hl=en_US&amp;start=</a>
After video creation and youtube compression, the fractal doesn't look nearly as good  Sad

Next steps are to improve visual appeal, improve render speed, export a very (very) large image to explore, and export a (much) higher quality video.  Smiley

Offline pitbuller
« Reply #3056 - Posted 2015-10-16 20:53:04 »

Does anyone know about PBR using HDR textures?

What you mean?
Render target need to be HDR and all emissive/cubemap textures.
Offline BurntPizza

« JGO Bitwise Duke »


Medals: 485
Exp: 7 years



« Reply #3057 - Posted 2015-10-17 18:55:18 »

Found what I'm going to call the new go-to "Juice it" video:

<a href="http://www.youtube.com/v/pmSAG51BybY?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/pmSAG51BybY?version=3&amp;hl=en_US&amp;start=</a>
Direct link
Offline ags1

JGO Kernel


Medals: 363
Projects: 7


Make code not war!


« Reply #3058 - Posted 2015-10-18 20:12:12 »

I took some baby steps in town planning.


Online SHC
« Reply #3059 - Posted 2015-10-19 05:19:46 »

I have tried to make a logo with the help of a friend Drenius for WebGL4J, a WebGL wrapper for Java.

(a):    (b): (c):

I personally prefer (a) and (c), and would like to know opinions of others too. Which one do you prefer most? Also any suggestions are appreciated.

Pages: 1 ... 100 101 [102] 103 104 ... 199
  ignore  |  Print  
 
 

 
ivj94 (583 views)
2018-03-24 14:47:39

ivj94 (47 views)
2018-03-24 14:46:31

ivj94 (374 views)
2018-03-24 14:43:53

Solater (61 views)
2018-03-17 05:04:08

nelsongames (108 views)
2018-03-05 17:56:34

Gornova (150 views)
2018-03-02 22:15:33

buddyBro (693 views)
2018-02-28 16:59:18

buddyBro (91 views)
2018-02-28 16:45:17

xxMrPHDxx (493 views)
2017-12-31 17:17:51

xxMrPHDxx (732 views)
2017-12-31 17:15:51
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
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!