Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (777)
Games in Android Showcase (231)
games submitted by our members
Games in WIP (856)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 ... 99 100 [101] 102 103 ... 207
  ignore  |  Print  
  What I did today  (Read 3010718 times)
0 Members and 4 Guests are viewing this topic.
Offline Icecore
« Reply #3000 - Posted 2015-10-09 23:20:21 »

Java Audio magic
not sure if i do it right - but:)
its looks strange - but looks work right ^^

How flush Data XD
1  
2  
3  
4  
5  
6  
7  
8  
9  
SourceDataLine Data_Out

Data_Out.stop();

synchronized(SSSS){//synchronized On - prevent Write Line dif Thread
    Data_Out.flush();
    Data_Out.start();
    Data_Out.stop();
}//synchronized off
You can't flush data when line Playng (sound distorsion)
But you also can't flush stoped line XD
Because to take effect you need start it agane ^^
lol

up: Hm.. - number smiles per lines 6 / 9 Smiley

Last known State: Reassembled in Cyberspace
End Transmission....
..
.
Journey began Now)
Offline wessles
« Reply #3001 - Posted 2015-10-10 06:25:53 »

I realized I didn't have a personal website up anymore since I switched hosts. While messing around with my wessles.com domain, I realized that my address was in the whois database for all to see. I figured this was a good opportunity to get around to buying a new domain and making a "studio" name, as opposed to me using my full name everywhere. I deleted the old domain, and bought systemvoidgames.com. I made the website itself today; I'd say it turned out pretty well Smiley.



-wes
Offline Icecore
« Reply #3002 - Posted 2015-10-10 09:23:29 »

Java Audio magic
How flush Data XD
Hm.. still have mini distortion Sad
But i think find new way
if set Line volume to 0
and play sample to end
it will be same like flush line for Listener =)

Anyone have better solution or something same?

Last known State: Reassembled in Cyberspace
End Transmission....
..
.
Journey began Now)
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Roquen

JGO Kernel


Medals: 518



« Reply #3003 - Posted 2015-10-10 10:17:09 »

Quote
should not be hand-written but generated from another easier to understand representation
Sure for complex systems...like continuations, fibers or actor frameworks as examples.  Use a DSL or some bytecode weaving (hopefully written by someone else) to do the lifting for you.  That only covers part of the problem space.  Otherwise you're doing 10x the effort to be 2x efficient.

Quote
Agreed on all points except "easier to read/understand."
I know.  I'm woefully old-school.  We have this quaint notion that code structure should reflect code behavior and not the currently fashionable notions of form, meter and prose.  Blame it on a lack of humanity courses.  So our code ends up looking like cookbook recipes instead of "flowing off the tongue" in a pleasing manner.
Offline kingroka123
« Reply #3004 - Posted 2015-10-11 01:24:49 »

I went back to my lighting demo stuff and completely redid how i calculated light. Now lights are much more versatile and just all around better:



Edit: these lights are still shaderless btw. The new algorthim is basically the combination of the old one plus another one maybe I'll explain it later

New features:
- better light ranges
- better shadows
- colors mxing is still very intact and pretty cool

Offline BCoding

Junior Devvie


Medals: 4
Exp: 4 years



« Reply #3005 - 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 #3006 - 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: 518



« Reply #3007 - 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
Offline SHC
« Reply #3008 - 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: 508
Projects: 3
Exp: 5 years


I'm the King!


« Reply #3009 - 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...

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Roquen

JGO Kernel


Medals: 518



« Reply #3010 - 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 Roquen

JGO Kernel


Medals: 518



« Reply #3011 - 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: 1060
Projects: 3
Exp: 20 years


Eh? Who? What? ... Me?


« Reply #3012 - 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: 518



« Reply #3013 - 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.
Offline princec

« JGO Spiffy Duke »


Medals: 1060
Projects: 3
Exp: 20 years


Eh? Who? What? ... Me?


« Reply #3014 - 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: 508
Projects: 3
Exp: 5 years


I'm the King!


« Reply #3015 - 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: 1357
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #3016 - 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: 518



« Reply #3017 - 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 #3018 - 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: 508
Projects: 3
Exp: 5 years


I'm the King!


« Reply #3019 - 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: 518



« Reply #3020 - 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: 333
Exp: 1 month or less


Zero but not.


« Reply #3021 - 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: 452
Projects: 7
Exp: 7 years


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


« Reply #3022 - 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: 367
Projects: 7


Make code not war!


« Reply #3023 - 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 VaTTeRGeR
« Reply #3024 - 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: 367
Projects: 7


Make code not war!


« Reply #3025 - 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: 452
Projects: 7
Exp: 7 years


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


« Reply #3026 - 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 Longarmx
« Reply #3027 - 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 #3028 - 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: 486
Exp: 7 years



« Reply #3029 - 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
Pages: 1 ... 99 100 [101] 102 103 ... 207
  ignore  |  Print  
 
 

 
hadezbladez (289 views)
2018-11-16 13:46:03

hadezbladez (157 views)
2018-11-16 13:41:33

hadezbladez (289 views)
2018-11-16 13:35:35

hadezbladez (71 views)
2018-11-16 13:32:03

EgonOlsen (2150 views)
2018-06-10 19:43:48

EgonOlsen (2152 views)
2018-06-10 19:43:44

EgonOlsen (1364 views)
2018-06-10 19:43:20

DesertCoockie (1983 views)
2018-05-13 18:23:11

nelsongames (1600 views)
2018-04-24 18:15:36

nelsongames (2248 views)
2018-04-24 18:14:32
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
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!