#jogamp @ irc.freenode.net - 20151227 05:05:13 (UTC)


20151227 05:05:13 -jogamp- Previous @ http://jogamp.org/log/irc/jogamp_20151226050513.html
20151227 05:05:13 -jogamp- This channel is logged @ http://jogamp.org/log/irc/jogamp_20151227050513.html
20151227 09:42:04 * bigpet (uid25664@anon) Quit (Quit: Connection closed for inactivity)
20151227 11:49:47 * spaceemotion (~spaceemot@anon) has joined #jogamp
20151227 15:18:10 * Eclesia (~eclesia@anon) has joined #jogamp
20151227 15:18:14 <Eclesia> hi
20151227 15:18:19 <bruce-> ehlo
20151227 15:18:55 <Eclesia> bruce-: hi, was the hints useful ?
20151227 15:21:14 <bruce-> Eclesia: I haven't tried it yet, but it seems like the only sensible way
20151227 15:50:51 <Eclesia> \o/
20151227 15:53:31 <Eclesia> looking good :) http://postimg.org/image/irp0ty91n/
20151227 15:58:00 <Eclesia> not very impressive I guess ...
20151227 16:29:57 <bruce-> I like it, how is your support for strokes now?
20151227 16:55:44 <spaceemotion> rmk0 hey, are you there? I got framebuffers somewhat working (don't mind the triangle at the bottom, still wrong vertices). but when I resize my window it does not resize the framebuffer properly it seems: http://puu.sh/makA7/2f2fbe99dd.png
20151227 16:56:16 <Eclesia> bruce-: not any better. working on other things, will have to do it eventually
20151227 16:56:38 <spaceemotion> I am currently just updating the texture using glTexImage2D, would I instead need to recreate a new one from scratch?
20151227 17:00:18 <Eclesia> spaceemotion: you have to unload the fbo, resize textures and reload it. load = genbuffer, bind, attachment ...
20151227 17:01:44 <spaceemotion> Eclesia this is what I currently got http://hastebin.com/isuposinud.java
20151227 17:01:46 <Eclesia> doesn't jogl already have an fbo class ?
20151227 17:02:40 <spaceemotion> hmm, never thought about that actually
20151227 17:04:51 <Eclesia> is it helps : https://bitbucket.org/Eclesia/unlicense/src/a8f50af223cf862e71dfe56e1604941005468e44/engine/engine-opengl-util/src/main/java/un/impl/opengl/resource/FBO.java?at=default&fileviewer=file-view-default#FBO.java-119 that's how I do it
20151227 17:07:17 <Eclesia> spaceemotion: just check each class for the type of object you work with : https://bitbucket.org/Eclesia/unlicense/src/tip/engine/engine-opengl-util/src/main/java/un/impl/opengl/resource/?at=default they all have loadOnGpu/unloadFromGPU methods. it should help you to figure out the gl call order
20151227 17:07:34 <spaceemotion> Eclesia alright, thanks!
20151227 17:08:12 <Eclesia> spaceemotion: but use the jogl classes if you can.
20151227 17:09:25 <spaceemotion> having a love/hate relationship with this modern ogl stuff right now, the fixed pipeline makes more sense, but once you got the preparation of shader based rendering done it offers way more possibilities
20151227 17:11:01 <Eclesia> I used only a little bit the fixed pipeline. I learning opengl only 2years ago starting with GL4
20151227 17:11:23 <Eclesia> +started
20151227 17:11:38 <spaceemotion> well, i really just started about 2 weeks ago and loving the challenge so far
20151227 17:11:58 <Eclesia> you will suffer for a few months ^^
20151227 17:12:22 <spaceemotion> I hope I can finish what I wanted within this christmas break :P
20151227 17:13:08 <spaceemotion> got a full month, so should be plenty time
20151227 17:13:34 <Eclesia> spaceemotion: this class should help you too : https://bitbucket.org/Eclesia/unlicense/src/tip/engine/engine-opengl-util/src/main/java/un/impl/opengl/GLC.java?at=default&fileviewer=file-view-default I made it to sort a little all the GL.* constants values. This is a real headache, it's so easy to use a wrong value.
20151227 17:14:03 <spaceemotion> oh thats fancy
20151227 17:15:03 <spaceemotion> although, aren't fields inside interfaces public static final by default? as well as interfaces in classes/interfaces ?
20151227 17:16:18 <Eclesia> public and static yes. final I'm not sure
20151227 17:18:33 <bruce-> Exception in thread "Thread-3" java.lang.ArrayIndexOutOfBoundsException: 1 at jogamp.opengl.GLBufferObjectTracker.notifyBuffersDeleted(GLBufferObjectTracker.java:250)
20151227 17:20:41 <bruce-> I get that after calling gl.glDeleteBuffers(GL.GL_ARRAY_BUFFER, new int[]{buffer}, 0);
20151227 17:21:52 <Eclesia> bruce-: wrong first argument
20151227 17:22:44 <Eclesia> bruce-: first argument is the number of buffer to delete
20151227 17:22:51 <Eclesia> -> 1
20151227 17:23:25 <bruce-> oh I see :)
20151227 17:23:40 <bruce-> hm, for same reason I don't have proper documentation in intellij
20151227 17:24:00 <bruce-> gives me public abstract void glDeleteBuffers(int i, int[] ints, int i1)
20151227 17:24:21 <bruce-> any idea how to fix that?
20151227 17:24:32 <Eclesia> I look on the web ^^
20151227 17:24:48 <spaceemotion> yeah, it only says it's the equivalent to the C function
20151227 17:24:50 <Eclesia> same problem on netbeans, jogl-all javadoc jar isn't available
20151227 17:25:10 <bruce-> I have always wondered why that is
20151227 17:25:15 <bruce-> it is super inconvenient
20151227 17:25:16 <Eclesia> have to declare jars one by one for the IDE to find the javadoc jars ...
20151227 17:27:10 <bruce-> I just want to right click on the maven dependency and select "download documentation" and want it to work :(
20151227 17:28:16 <spaceemotion> it actually downloaded the source jar without a problem…
20151227 17:28:34 <rmk0> (<_<)
20151227 17:28:36 <rmk0> (>_>)
20151227 17:29:01 * spaceemotion o/ rmk0
20151227 17:29:09 <rmk0> lo
20151227 17:29:29 <Eclesia> rmk0: hi
20151227 17:29:45 <rmk0> ello
20151227 17:33:06 <rmk0> not sure why the maven packages might not work... not actually seen that here
20151227 17:33:20 <rmk0> is there something i can adjust to make it work?
20151227 17:36:14 <Eclesia> the javadoc jar is not deployed, looks like it's the only thing missing
20151227 17:36:36 <bruce-> also, the javadoc jars are very small, but I have too little understanding of how maven and javadoc jars work together
20151227 17:36:57 * rmk0 eyes it
20151227 17:36:58 <spaceemotion> strange, i got it from maven…: http://puu.sh/mamDT/4bdb733525.png
20151227 17:38:50 <bruce-> how do I get to that view?
20151227 17:39:02 <spaceemotion> its under file -> project structure -> libraries
20151227 17:39:29 <bruce-> ah, yeah just found it
20151227 17:39:55 <bruce-> it also says it has a javadoc jar for me
20151227 17:40:47 <Eclesia> rmk0: http://jogamp.org/deployment/maven/org/jogamp/jogl/jogl-all/2.3.2/
20151227 17:40:55 <Eclesia> jogl-all-2.3.2-javadoc.jar is empty
20151227 17:40:59 <bruce-> 345B Oct 11 14:25 jogl-all-main-2.3.2.jar
20151227 17:41:06 <rmk0> right
20151227 17:44:01 <rmk0> feel like there was a reason for this...
20151227 17:48:25 <spaceemotion> IntelliJ should still prefer sources over javadocs…
20151227 17:48:52 <Eclesia> rmk0: a grudge against intellij/netbeans users ? :D
20151227 17:52:37 <rmk0> could be!
20151227 17:58:47 <rmk0> i've been using intellij for about a year now and haven't noticed a problem. i'm guessing they do work from sources instead of the compiled javadocs
20151227 17:59:31 <rmk0> writing code that consumed the output of the javadoc tool seems like it would be horrible
20151227 18:00:16 <bruce-> I like how javadoc is still stuck halfway the 90s
20151227 19:39:31 <Eclesia> ping ?
20151227 19:42:56 * Eclesia (~eclesia@anon) Quit (Quit: Leaving.)
20151227 19:43:17 * Eclesia (~eclesia@anon) has joined #jogamp
20151227 19:44:56 <spaceemotion> pong
20151227 20:19:43 <spaceemotion> rmk0 alright, so I got the framebuffer stuff fully working (even with resizes), how do I do that "tile index" thing for the picking now?
20151227 20:33:46 <rmk0> spaceemotion: you mentioned that you're passing in the object index to a shader as a parameter
20151227 20:34:11 <rmk0> what does the fragment shader look like for that?
20151227 20:35:17 <spaceemotion> http://hastebin.com/viyixagizi.java
20151227 20:35:26 <spaceemotion> i just re-read what you said yesterday
20151227 20:35:56 <spaceemotion> i imagine I can just drop the vec4 and render a vec3 using a RED_32 color, right?
20151227 20:36:10 <spaceemotion> so if I render everything with its "index", how do I read a pixel from the texture then?
20151227 20:36:36 <rmk0> yeah, the colors become unsigned int values
20151227 20:37:04 <rmk0> if you need to read the pixel from within a shader, you can just pass in the framebuffer color attachment as a texture
20151227 20:37:27 <rmk0> if you need to read it from the CPU side, use glGetTexImage
20151227 20:37:35 <spaceemotion> ah okay
20151227 20:37:56 <spaceemotion> if I pass in my index, how does the output color look like then?
20151227 20:38:05 <spaceemotion> out int outputColor ?
20151227 20:38:43 <rmk0> uint
20151227 20:50:11 * bigpet (uid25664@anon) has joined #jogamp
20151227 21:04:04 <spaceemotion> rmk0 hmm, it says "unsigned int can't be an in in the fragment shader"
20151227 21:04:28 <spaceemotion> http://hastebin.com/uhowoxeyik.java this is the updated shader code
20151227 21:20:09 <rmk0> i would declare the "uniform uint u_index" in the fragment shader directly and not pass it through the vertex shader
20151227 21:20:30 <spaceemotion> oh, so fragments can pick up uniforms as well? didn't know that!
20151227 21:22:30 <spaceemotion> oh dang, "format 0x8236 not supported [yet], pls notify the maintainer in case this is our bug."
20151227 21:22:42 <spaceemotion> i tried to glReadPixels with GL3.GL_R32UI
20151227 21:23:04 <spaceemotion> http://hastebin.com/qiyagekuja.java
20151227 21:23:08 <rmk0> erk!
20151227 21:23:43 <spaceemotion> might be doing something wrong though (as it says)
20151227 21:24:24 <spaceemotion> hmmm… nope R32UI is not in the list, how much would it normally have though?
20151227 21:25:02 <rmk0> you're still using glReadPixels?
20151227 21:25:26 <spaceemotion> well, you said I should use glGetTexImage, but wouldn't that return the full image? I just need 1 pixel…
20151227 21:26:53 <rmk0> i think you need GL_RED instead of GL_R32UI, and GL_UNSIGNED_INT instead of GL_UNSIGNED_BYTE
20151227 21:28:12 <spaceemotion> now it just returns invalid operation
20151227 21:29:10 <rmk0> have you bound the framebuffer to GL_READ_FRAMEBUFFER?
20151227 21:29:25 <rmk0> you've most likely got it bound to GL_DRAW_FRAMEBUFFER for rendering
20151227 21:29:43 <spaceemotion> i got it to just GL_FRAMEBUFFER, so wouldn't that be both?
20151227 21:30:14 <rmk0> not sure without checking the spec
20151227 21:31:48 <spaceemotion> alright, so binding the normal buffer to GL_DRAW_FRAMEBUFFER works, and binding before the glReadPixels to READ_FRAMEBUFFER gives me no errors but I only get a 0 back …
20151227 21:32:23 <rmk0> welcome to opengl!
20151227 21:32:28 <spaceemotion> \o/
20151227 21:32:42 <spaceemotion> switching to render the "picking" fbo, just returns a black image…
20151227 21:34:54 <spaceemotion> I am using GL_DEPTH24_STENCIL8 for glRenderbufferStorage and GL_COLOR_ATTACHMENT0 for the attachement
20151227 21:37:32 <rmk0> given that you have no apitrace, i think your only available option is to fetch the whole image with glGetTexImage and write it to a file to see what's in it
20151227 21:37:44 <spaceemotion> urgh hahaha
20151227 21:42:17 <spaceemotion> well, sadly, time's up. let's leave that for tomorrow, cheers!
20151227 21:43:07 <rmk0> byee
20151227 21:49:09 * Eclesia waht do I do next .... hmm.....
20151227 21:50:57 <bruce-> libfreetype port to java
20151227 21:52:07 <Eclesia> bruce-: can't do that. not public domain license
20151227 21:53:07 <spaceemotion> maybe try to fix font rendering for jogl? currently not possible with GL3 :/ https://github.com/sgothel/jogl/pull/47
20151227 21:56:45 * Eclesia will work on the UI editor and physic engine a little
20151227 22:43:50 <Eclesia> good night ++
20151227 22:43:53 * Eclesia (~eclesia@anon) Quit (Quit: Leaving.)
20151227 23:12:12 * spaceemotion (~spaceemot@anon) Quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
20151227 23:38:25 * jk4_ (~jk4@anon) Quit (Quit: WeeChat 1.1.1)
20151228 00:47:43 * spaceemotion (~spaceemot@anon) has joined #jogamp
20151228 00:52:40 * spaceemotion (~spaceemot@anon) Quit (Ping timeout: 272 seconds)
20151228 05:05:13 -jogamp- Continue @ http://jogamp.org/log/irc/jogamp_20151228050513.html