#jogamp @ irc.freenode.net - 20160105 05:05:15 (UTC)


20160105 05:05:15 -jogamp- Previous @ http://jogamp.org/log/irc/jogamp_20160104050514.html
20160105 05:05:15 -jogamp- This channel is logged @ http://jogamp.org/log/irc/jogamp_20160105050515.html
20160105 07:37:20 * diamondm1n (~diamondma@anon) has joined #jogamp
20160105 07:39:43 <diamondm1n> Hey guys. A kid I taught Java a while ago wanted to learn opengl so I got him a book. I remember the android sstuff I did in opengl being very similar to the C API. Looking over jogl api that is being exposed, parameters are VERY different. I am having trouble drawing a parallel between the jogl api and many of the C apis. What am I doing wrong/what is my misunderstanding/why was this intentional
20160105 07:41:41 * jvanek (jvanek@anon) has joined #jogamp
20160105 07:50:59 * elect (~GBarbieri@anon) has joined #jogamp
20160105 08:08:28 * monsieur_max (~maxime@anon) has joined #jogamp
20160105 08:14:18 <zubzub> diamondm1n: jogl is not a pure 1to1 mapping, however most of it's api's are near identical to the opengl api
20160105 08:14:39 <zubzub> the major difference being setting up a context and drawing surface
20160105 08:18:52 <diamondm1n> zubzub: fair. The function I was having issues with was glVertexAttribPointer
20160105 08:19:28 <zubzub> the thing is that for some cases java provides the size of a block of memory inside it's buffer object
20160105 08:19:52 <zubzub> so it doesn't make sense to ask the user to provide that information when passing it as an argument
20160105 08:20:14 <diamondm1n> that makes sense,
20160105 08:20:28 <diamondm1n> some of this may be... silly questions. I will try to limit them
20160105 08:20:47 <diamondm1n> I get why there would not be length specified in a language that has type information available at runtime.
20160105 08:20:48 <zubzub> I'm not a jogl expert either so I won't be able to answer probably most of them either :p
20160105 08:21:04 <diamondm1n> hehe np, thanks for the attempt ahead of time
20160105 08:25:03 <diamondm1n> While I try to get the information for my question, you may be able to answer this. https://github.com/elect86/jogl-samples/blob/master/jogl-samples/src/helloTriangle/HelloTriangle.java
20160105 08:25:21 <diamondm1n> I decided to have him use this as a template to get the initial context/etc set up
20160105 08:25:32 <diamondm1n> but there is an import here that I do not recognize.
20160105 08:25:38 <monsieur_max> diamondm1n: elect is right here ;) ask him
20160105 08:25:56 <diamondm1n> oh shit he is. I sent him an email already
20160105 08:26:06 <monsieur_max> elect: mr consultant please
20160105 08:26:09 <diamondm1n> but asked here in case I could get a quicker answer lol
20160105 08:27:14 <diamondm1n> If he is here, or asleep, I am lost on what 'import framework.Semantic;' is
20160105 08:27:16 <monsieur_max> diamondm1n: he usually answers quickly , fine guy
20160105 08:27:34 <diamondm1n> I assume he is with the quantity and quality of his work on github
20160105 08:28:02 <monsieur_max> diamondm1n: also, he's in europe so it's daytime
20160105 08:29:04 <diamondm1n> ah, idk, he could have a terrible schedule and be asleep. I am in California and have a terrible schedule for still being up
20160105 08:30:17 <zubzub> it's 9:25 in the morning here
20160105 08:31:36 <diamondm1n> Hmm, well I would love to not have to go to irc to ask simple questions about APIs, but I found the javadocs very..... vague. All describing interfaces, and somehow describing the c version of the api. http://jogamp.org/deployment/v2.3.2/javadoc/jogl/javadoc/com/jogamp/opengl/GL2ES2.html#glVertexAttribPointer(int, int, int, boolean, int, long) Unless these are just external function declarations....
20160105 08:31:44 <diamondm1n> I must be looking in the wrong place
20160105 08:38:30 <elect> hey
20160105 08:38:33 <elect> let me catch up
20160105 08:39:15 <diamondm1n> Thanks for your email reply
20160105 08:39:28 <elect> np
20160105 08:39:45 <elect> did you solve?
20160105 08:39:52 <diamondm1n> wow, I am embarassed I missed that in the src directory. Thanks
20160105 08:39:59 <elect> it happens
20160105 08:40:05 <elect> not a big deal
20160105 08:40:06 <diamondm1n> I should just have checked out the whole project
20160105 08:44:39 <monsieur_max> elect: you're getting famous pal :)
20160105 08:45:23 <elect> he is another paid actor of mine
20160105 08:45:31 <elect> for my ego
20160105 08:45:42 <monsieur_max> ah, now that makes sense !
20160105 08:45:48 <elect> :p
20160105 08:48:27 <diamondm1n> shush... I don't know if I get paid if you let onto the con
20160105 08:50:10 <elect> :D
20160105 08:51:04 <diamondm1n> Here is a place in jogl where I am not quite getting the translation from the C API to Java. https://github.com/elect86/jogl-samples/blob/master/jogl-samples/src/helloTriangle/HelloTriangle.java#L177-L178 In C, the last argument to that function is a const void pointer. Obviously we don't get that same level of control in Java, but in the line I ihghlighted, we are passing in '0 * GLBuffers.SIZEOF_BYTE'
20160105 08:51:21 <diamondm1n> I expected something like a byte array or....
20160105 08:52:30 <elect> that's the offset
20160105 08:52:43 <elect> they are interleaved,
20160105 08:52:49 <elect> for each vertex attributes
20160105 08:52:54 <elect> we have position and color
20160105 08:53:06 <elect> position is on offset 0, color on offset 2
20160105 08:53:38 <elect> I will expand the comment
20160105 08:53:57 <diamondm1n> ok, but where is the actual buffer passed in.
20160105 08:54:14 <elect> https://github.com/elect86/jogl-samples/blob/master/jogl-samples/src/helloTriangle/HelloTriangle.java#L130
20160105 08:54:18 <diamondm1n> (And I understand the offset of a vbo)
20160105 08:56:05 <diamondm1n> oh god
20160105 08:56:09 <diamondm1n> I remember now...
20160105 08:56:40 <diamondm1n> That is the pointer to the first element of the buffer, but the buffer is copied with glBufferData.
20160105 08:56:48 <diamondm1n> Thanks again. Been way too long
20160105 08:57:01 <elect> I can image
20160105 08:57:07 <elect> anyway you have also another possibility
20160105 08:58:38 <elect> but I am not there yet with the samples
20160105 08:58:42 <elect> ^^
20160105 08:59:12 <monsieur_max> diamondm1n: what's your plan with jogl , a game ?
20160105 09:01:46 <diamondm1n> monsieur_max: Well, a little more simple. I started some opengl stuff a few years ago around GLES2. I would have used normal GL but linux drivers at the time.... you know
20160105 09:02:01 <diamondm1n> So I did my work on android and made mandelbrot sets and stuff like that
20160105 09:02:15 <diamondm1n> Got really excited by the idea of compute shaders available in opengl
20160105 09:02:21 <diamondm1n> but that was all far away in ES2
20160105 09:02:45 <diamondm1n> I went off and did random other things with FPGAs, etc
20160105 09:03:09 <diamondm1n> now a friend I taught to code (14 year old now i think) was building games
20160105 09:03:14 <monsieur_max> diamondm1n: interesting
20160105 09:03:56 <diamondm1n> but he was hand writing his own basic rasterizers. Not 3d, but some pieces that he could have used libraries for. I was like... pretty cool, but use these library calls to save work unless you just love writing this stuff
20160105 09:04:16 <diamondm1n> Later he started trying to make a 3d rasterizer and I asked him again if he wanted to design a rasterizer or make a game
20160105 09:04:31 <diamondm1n> he said make a game, so I got him the revised version of the GL book I learned from
20160105 09:04:50 <diamondm1n> And then had to teach him a bit of C so he could read the damn thing
20160105 09:05:09 <zubzub> diamondm1n: there is/will be a series on how quake 1 works/is designed
20160105 09:05:16 <zubzub> just a sec
20160105 09:05:33 <diamondm1n> nice, that would be fun
20160105 09:05:46 <zubzub> https://www.youtube.com/playlist?list=PLBKDuv-qJpTbCsXHsxcoSSsMarnfyNhHF
20160105 09:06:00 <elect> who is that guy, zubzub ?
20160105 09:06:07 <zubzub> elect: no idea :p
20160105 09:06:25 <zubzub> http://philipbuuck.com/announcing-handmade-quake
20160105 09:06:31 <monsieur_max> zubzub: ah nice, reminds me of : https://www.youtube.com/watch?v=oHg5SJYRHA0
20160105 09:06:33 <zubzub> if you want to know more
20160105 09:06:58 <diamondm1n> In Java there are so many damn ways to set up your context, and ooops, that is the old way that only supports GL1 and 2 calls, etc etc etc. Found the example on the jogl site how to set up a GL4 context, and then hit a wall with my memory of why a C function took a pointer, and the java version took a long. :) (It was because it was the offset durr)
20160105 09:07:21 <diamondm1n> Awesome, I will watch these and pass them along
20160105 09:07:25 <elect> interesting link, zubzub
20160105 09:08:36 <diamondm1n> well
20160105 09:08:38 <diamondm1n> except that link
20160105 09:08:44 <diamondm1n> diiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiick
20160105 09:09:12 <elect> ^^
20160105 09:09:26 <zubzub> I don't understand the fuzz about it
20160105 09:09:30 <zubzub> it's an ok song
20160105 09:09:47 <diamondm1n> It is, it is more that outrage is part of the joke
20160105 09:11:01 <diamondm1n> Plus earlier on people would set up sites that used semi malicious (read 'annoying') java script (before there were limits how many times a pop up box could appear before the browser asked if you wanted to disable js) to make epilepcy web pages playing that song that could not be closed without force killing your browser
20160105 09:11:44 <diamondm1n> So getting rick rolled was more rage inducing
20160105 09:12:01 <monsieur_max> sorry about that
20160105 09:12:08 <diamondm1n> And the general case of expecting something relevant or interesting and hearing that start up.
20160105 09:12:15 <diamondm1n> Nah np. All part of the joke
20160105 09:14:20 <diamondm1n> Anyway, back to gl. This kid will be doing gl in java because he is comfortable there. I prefer C, so once I get FUCKING bumblebee working with my kernel, I will be able to use GL 4.4, or at leasat a version that allows me to make stored textures with channels not clipped to (0.0, 1.0) so I can make a cool mandelbrot drawer
20160105 09:14:35 <diamondm1n> But yeah... that is basically my adventures with GL
20160105 09:15:31 <elect> I should read one day what all these mandelbrot are about
20160105 09:16:52 <monsieur_max> diamondm1n: ah bumblebee :) so much fun ...
20160105 09:17:00 <diamondm1n> elect It is pretty easy to draw one
20160105 09:17:49 <diamondm1n> monsieur_max: Hah, I am glad you think so. I am running newest kernel, newest bumblebee, and tried it with several versions of the DRI (or DRM?) library (all nouveau drivers) and I still am getting permission denied.
20160105 09:18:07 <diamondm1n> unable to set DRM interface version to 1.4
20160105 09:18:38 <diamondm1n> elect: Are you unaware of how they are drawn? What they look like, or what, besides their cool look, people like about them?
20160105 09:18:53 <elect> yes, totally unaware
20160105 09:18:54 <monsieur_max> diamondm1n: i solved it using a very straightforward way ... forcing concrete gpu in bios and using the nvidia drivers :)
20160105 09:19:03 <elect> I saw them in different samples
20160105 09:19:35 <elect> I image some sort of algorithm behind but I didnt have the chance to take a look to one of them closely yet
20160105 09:19:47 <elect> it's on my todo list
20160105 09:19:49 <diamondm1n> monsieur_max: Sigh, Yeah I should likely force the card in the bios though sometimes that causes problems. And i must be cursed because every time I try nvidia drivers my X get progressively worse as I try to fix it and I end up reinstalling my OS.
20160105 09:20:07 <elect> which distro do you use?
20160105 09:20:09 <diamondm1n> I can give you a super brief overview if you are interested
20160105 09:20:14 <diamondm1n> If not now, I have your email
20160105 09:20:20 <diamondm1n> debian Jessie
20160105 09:20:26 <diamondm1n> kernel 4.4 rc6 atm
20160105 09:20:33 <elect> I wouldnt like to waste your time for somethin I can read online
20160105 09:20:47 <elect> ah, I read the author passed away few days ago
20160105 09:20:52 <diamondm1n> lol, well, I just wasted your time for something I SHOULD have been able to find :)
20160105 09:21:00 <diamondm1n> yeah... it was sad
20160105 09:21:01 <elect> that was nothing ;)
20160105 09:21:28 <elect> if I recall properly debian was a combination of his name and his wife
20160105 09:21:37 <elect> cool name
20160105 09:21:40 <diamondm1n> yeah, neither is mandelbrot. seriously. If you know the following, it can be briefly explained in like 4 sentences: Do you know what the complex plane is, and what complex numbers are
20160105 09:21:52 <elect> complex numbers yes
20160105 09:21:58 <elect> complex plane not
20160105 09:22:01 <diamondm1n> I think Debian was named after a Girlfriend named Debra
20160105 09:22:21 <diamondm1n> well a complex plane is super simple with complex numbers. you know how we have a number line for real numbers?
20160105 09:22:36 <elect> what do you mean?
20160105 09:22:41 <diamondm1n> If we have a complex number Z = R + iX where i is sqrt(-1)
20160105 09:22:57 <diamondm1n> oh
20160105 09:23:00 <diamondm1n> I mean, like
20160105 09:23:36 <diamondm1n> In america this 'number line' is used to show children that numbers are continuous http://www.mathatube.com/sitebuilder/images/number-line-600x271.png
20160105 09:23:46 <diamondm1n> It may be called something different elsewhere
20160105 09:23:50 <diamondm1n> or taught differently
20160105 09:24:38 <elect> ah
20160105 09:24:45 <diamondm1n> but the point is that for a float, we have a single dimention to traverse
20160105 09:25:33 <diamondm1n> for a complex number that includes a real part and an imaginary part, we have two axis, so a regular number line no longer works and we need a plane
20160105 09:25:38 <diamondm1n> http://pirate.shu.edu/~wachsmut/complex/numbers/graphics/plane.gif
20160105 09:26:04 <diamondm1n> The x axis is the same 'number line' while the y axis is the 'number line' of the imaginary part
20160105 09:26:28 <diamondm1n> thus we have a plane where a coordinate represents a complex number
20160105 09:26:39 <diamondm1n> woo, complex plane
20160105 09:27:04 <diamondm1n> follow so far?
20160105 09:27:08 <elect> yep
20160105 09:27:14 <diamondm1n> yay
20160105 09:27:28 <diamondm1n> so luckily, we can represent this plane with any plane and just label the axis
20160105 09:27:43 <diamondm1n> that will come up later but you likely know that with all the linear algebra needed in GL
20160105 09:27:54 <diamondm1n> So imagine a function
20160105 09:28:03 <diamondm1n> f(z) that takes in a complex number
20160105 09:28:14 <diamondm1n> f(z) = z^2 + c
20160105 09:28:24 <diamondm1n> where c is a constant complex number
20160105 09:28:58 <diamondm1n> we can plug in a complex number in and get one back out
20160105 09:29:35 <diamondm1n> We can put any point from the complex plane into this function
20160105 09:29:39 <diamondm1n> but there is an interesting rule
20160105 09:29:51 <diamondm1n> based on math I do not remember, you can draw a circle around the origin
20160105 09:30:22 <diamondm1n> and say that any point you put into the equation, the resule will be guaranteed to be farther from the origin
20160105 09:30:50 <diamondm1n> follow? That part can be weird
20160105 09:31:29 <elect> kind of
20160105 09:31:39 <elect> what is this origin?
20160105 09:31:53 <diamondm1n> the origin is the complex number Z=0 + 0i
20160105 09:31:57 <elect> because there are different circles
20160105 09:32:11 <diamondm1n> well, the circle we draw is based on the constant c
20160105 09:32:23 <diamondm1n> I do not remember the equation to get the radius of the circle based on c
20160105 09:32:29 <diamondm1n> but it is centered at the origin
20160105 09:32:34 <elect> ok
20160105 09:32:43 <diamondm1n> so for our function f(z)
20160105 09:33:01 <diamondm1n> if we put any input point outside the circle, we are guaranteed to have an output farther from the circle
20160105 09:33:22 <diamondm1n> put points on the inside may pass through f(z) and produce results that are still in the circle
20160105 09:33:53 <diamondm1n> That is most of the rules of thie world. The last thing is the definition of what the mandelbrot set is
20160105 09:34:53 <elect> are they used for some purpouse in particular?
20160105 09:35:03 <elect> or are they just a graphical representation?
20160105 09:35:11 <diamondm1n> the mandelbrot set is the set of all points on the complex plane (so every complex number) that when put through f(z), and that result put back into f(z), over and over again like f(f(f(f(f(f(f(f(f(f(z)))))))))))) for infinity
20160105 09:35:23 <diamondm1n> that the result after infinite calls to f
20160105 09:35:30 <diamondm1n> the result is still inside the circle
20160105 09:35:43 <diamondm1n> well, complex planes are used for signal analysis
20160105 09:36:03 <diamondm1n> the mandel brot set, and similar sets, are fractals based off simple rules that have deep math implications
20160105 09:36:27 <diamondm1n> so lets say we take a point on the complex plane, z
20160105 09:36:33 <diamondm1n> and put it into f(z)
20160105 09:36:36 <diamondm1n> and get z1
20160105 09:36:52 <diamondm1n> z1 is still inside the circle so we can say that z passes our test 1 time so far
20160105 09:36:57 <diamondm1n> then we do it again
20160105 09:37:04 <diamondm1n> z2 = f(z1)
20160105 09:37:11 <diamondm1n> z2 is still in the circle
20160105 09:37:17 <diamondm1n> so we keep doing it until z15
20160105 09:37:30 <diamondm1n> then z15 is out of the circle which means it can never come back inside
20160105 09:37:55 <diamondm1n> that means z passed our test 15 times
20160105 09:37:56 <elect> recursive until out of circunference
20160105 09:38:02 <diamondm1n> yep
20160105 09:38:19 <diamondm1n> so we can run this recursive test on every single point on the plane
20160105 09:38:27 <diamondm1n> and count how many test iterations it passes
20160105 09:38:32 <diamondm1n> each point passes
20160105 09:38:43 <diamondm1n> and based on that count, we pick a color
20160105 09:38:54 <diamondm1n> the ones that pass every test we have tried will be black
20160105 09:39:01 <diamondm1n> everything else can be a selection of an array
20160105 09:39:23 <diamondm1n> This is the result of one iteration step at a time
20160105 09:39:25 <diamondm1n> https://upload.wikimedia.org/wikipedia/commons/f/f4/Animation_of_the_growth_of_the_Mandelbrot_set_as_you_iterate_towards_infinity.gif
20160105 09:40:17 <diamondm1n> It looks like their color pallet changes each iteration, shifting down
20160105 09:40:40 <diamondm1n> But the crazy thing about this shape, and all other fractals generated by it (a different fractal for each value of c)
20160105 09:40:48 <diamondm1n> is that it has infinite surace area
20160105 09:41:21 <elect> than it is just a matter of how deep you want to go and which kind of color selection you apply
20160105 09:41:52 <diamondm1n> https://www.youtube.com/watch?v=gEw8xpb1aRA
20160105 09:41:58 <diamondm1n> exactly
20160105 09:42:00 <elect> I remember one sample when I was zooming in continuosly and new images were coming out
20160105 09:42:47 <diamondm1n> The problem of zooming that deep with something generated by a gpu is that you quickly lose the accuracy needed to deal with such fine grained numbers
20160105 09:43:06 <diamondm1n> so all the super duper high resolution ones are rendered with some techniques to compensate for that
20160105 09:43:58 <diamondm1n> I have implemented this with two tris making a square, two varying variables of X and Y, and a vertex shader that applied the math
20160105 09:44:11 <diamondm1n> pretty fun to do
20160105 09:44:19 <diamondm1n> IF!!!! you can get your fucking drivers working
20160105 09:44:26 <diamondm1n> sigh
20160105 09:44:58 <diamondm1n> But knowing that, and looking up the equation to calculate the circle, most people here could likely implement this in a few minutes
20160105 09:45:35 <monsieur_max> don't overestimate us
20160105 09:45:52 <diamondm1n> lol
20160105 09:46:01 <diamondm1n> The vertex/fragment shader is trivial
20160105 09:46:05 <diamondm1n> you take in the x and y
20160105 09:46:16 <diamondm1n> and treat is as the real and complex part of the equation
20160105 09:46:19 <diamondm1n> dr
20160105 09:46:20 <diamondm1n> er
20160105 09:46:24 <diamondm1n> of the complex number
20160105 09:46:46 <diamondm1n> run a for loop 20 times that applies the operation
20160105 09:47:03 <diamondm1n> and check how many times it passes.
20160105 09:47:12 <zubzub> 10:45 < monsieur_max> don't overestimate us
20160105 09:47:15 <zubzub> speak for yourself
20160105 09:47:16 <diamondm1n> Select a color from a look up table
20160105 09:47:23 <zubzub> I know some of the words diamondm1n is saying
20160105 09:48:25 <monsieur_max> zubzub: even this 'circle' thing ?
20160105 09:48:33 <diamondm1n> Here is how to multiply two complex numbers. note here they use j for sqrt(-1)
20160105 09:48:34 <diamondm1n> http://www.electronics-tutorials.ws/accircuits/acp60.gif?81223b
20160105 09:49:45 <diamondm1n> so given x as the real part and y as the imaginary part, the actual operation is east. Let me find the circle
20160105 09:50:01 <zubzub> monsieur_max: yes, well, I heard of it once...
20160105 09:51:41 <diamondm1n> Also while I look.... I do not know how to render these, but this is somehow making a 3d version of these equations
20160105 09:51:44 <diamondm1n> https://www.youtube.com/watch?v=xO5fXGqeM5c
20160105 09:52:37 <diamondm1n> Here, the bound is defined on wiki
20160105 09:52:39 <diamondm1n> https://en.wikipedia.org/wiki/Mandelbrot_set
20160105 09:53:10 <elect> what's the 3rd dimension in that case?
20160105 09:53:46 <diamondm1n> lol, I have no idea what the 3rd dimension is
20160105 09:53:58 <diamondm1n> and if I get gl working, I will figure the math out to make these damn things
20160105 09:54:28 <diamondm1n> But clearly they could be generated by some sort of geometry shader, and colored by a fragment shader. Would be fun to implement
20160105 09:57:05 <diamondm1n> hmm, here is a fragment shader from my first profoundly shitty version https://github.com/diamondman/JuliaGLAndroid/blob/master/res/raw/juliafbofrag.frag
20160105 09:57:28 <diamondm1n> Oh well, I hope I have contributed to this channel tonight (for me, today for you people).
20160105 09:57:40 <diamondm1n> And not just babbled till everyone got sick of me :)
20160105 09:58:12 <diamondm1n> I will be going to bed soon. Thanks for the very friendly welcome and assistance
20160105 09:58:54 <monsieur_max> you're welcome here anytime diamondm1n
20160105 10:00:11 <diamondm1n> thanks. Normally it is diamondman, but logged in at work... blah
20160105 10:00:18 <diamondm1n> In other words, if the absolute value of P_c^n(0) ever becomes larger than 2, the sequence will escape to infinity. (From the wikipedia)
20160105 10:00:32 <diamondm1n> If anyone gets bored and implements one, I want to see it
20160105 10:01:25 <elect> thanks diamondm1n
20160105 10:01:29 <diamondm1n> :)
20160105 10:01:59 <diamondm1n> You are all very nice. Most irc rooms need you to prove competency before niceness. That is fine, but I appreciate it. night
20160105 10:03:36 <elect> night
20160105 10:34:39 <rmk0> .o.
20160105 11:33:29 * Eclesia (~husky@anon) has joined #jogamp
20160105 11:33:36 <Eclesia> hi
20160105 11:37:56 <rmk0> lo
20160105 11:57:00 * odin_ (~Odin@anon) Quit (Ping timeout: 250 seconds)
20160105 12:17:15 * odin_ (~Odin@anon) has joined #jogamp
20160105 12:31:53 * philjord2 (599cc172@anon) has joined #jogamp
20160105 12:37:25 <philjord2> sgothel can I ask you a quick question?
20160105 12:39:17 <zubzub> you just did
20160105 12:39:30 <philjord2> Yes good point...
20160105 12:40:10 <philjord2> sgothel can I ask you one more question following this one, not including this one nor the one I ask a moment ago?
20160105 12:41:32 <philjord2> zubzub I have a question perhaps you could answer it?
20160105 12:42:10 <philjord2> My Dell XPS laptop running an Intel HD Graphics 300 card, worked perfectly with jogl 2.3.2 until I upgraded to windows 10
20160105 12:42:59 <philjord2> now for some crazy reason I'm getting a software GL4 profile back where I used to get a working GL2 hardware profile
20160105 12:43:13 <philjord2> My graphics drivers are unchanged and the latest
20160105 12:44:55 <philjord2> I see a few profile mapping bugs in bugzilla like https://jogamp.org/bugzilla/show_bug.cgi?id=1052
20160105 12:45:03 <philjord2> but they are all marked resolved.
20160105 12:45:35 <philjord2> So my question is, should I simply open a new bug report, or would I be doubling up on something that's known?
20160105 12:45:58 <philjord2> Long intro, quick question
20160105 12:46:19 <zubzub> philjord2: no idea, sounds like you need to (re)open a bug report
20160105 12:46:37 <zubzub> philjord2: or it could be that your driver doesn't support gl on windows10 (?)
20160105 12:47:09 <philjord2> No the debug output clearly shows GL2 being fine, it's just picking the wrong profile
20160105 12:47:32 <philjord2> I'll open a bug and attach the log and that's cool
20160105 14:22:06 * philjord2 (599cc172@anon) has left #jogamp
20160105 16:27:53 * elect (~GBarbieri@anon) Quit (Ping timeout: 246 seconds)
20160105 16:32:39 * jvanek (jvanek@anon) Quit (Quit: Leaving)
20160105 16:52:58 * monsieur_max (~maxime@anon) Quit (Quit: Leaving.)
20160105 17:06:21 * Eclesia (~husky@anon) has left #jogamp
20160105 17:18:12 <rmk0> anyone using an (open source) java benchmarking tool that they actually like?
20160105 17:18:44 <rmk0> i'm not looking for profiling, but am looking to write functions that look like unit tests, the running time of which can be tracked over time
20160105 17:29:18 * monsieur_max (~maxime@anon) has joined #jogamp
20160105 18:28:26 * badshah400 (~badshah40@anon) has joined #jogamp
20160105 19:49:56 <zubzub> rmk0: https://groups.google.com/forum/#!msg/mechanical-sympathy/m4opvy4xq3U/7lY8x8SvHgwJ ?
20160105 19:50:36 <rmk0> zubzub: ... i'd actually forgotten i'd asked here. am currently working through the jmh samples
20160105 19:50:39 <rmk0> it seems decent!
20160105 19:51:11 <zubzub> yeah loos like jmh is what you want for benchmarking
20160105 19:51:19 <zubzub> *looks
20160105 20:13:18 * Eclesia (~eclesia@anon) has joined #jogamp
20160105 20:32:10 <rmk0> hrm, so i get ~18 million 4x4 matrix multiplications a second if the matrices are backed by java heap arrays, and ~6 million a second if they're backed by direct bytebuffers
20160105 20:33:41 <rmk0> neither of them allocate memory during execution
20160105 20:36:58 <rmk0> that's single-threaded
20160105 20:42:54 <rmk0> if i use four threads, i get ~35 million
20160105 20:43:27 <rmk0> but... can't use that to speed up the direct-memory backed version because ByteBuffers aren't thread safe >_<
20160105 20:47:01 <zubzub> ?
20160105 20:47:18 <rmk0> sorry, just blabbering to myself
20160105 20:47:41 <zubzub> than make them thread safe?
20160105 20:47:45 <zubzub> *then
20160105 20:47:55 <rmk0> i'm working on instancing, and it involves performing a lot of matrix multiplications on the cpu before passing the resulting buffer of matrices to the gpu
20160105 20:47:59 <zubzub> or make sure you atomize your operations on them
20160105 20:48:19 <rmk0> i haven't yet determined whether or not lock contention will make it worse
20160105 20:48:23 <rmk0> still measuring
20160105 20:48:44 <zubzub> why do the multiplications in the cpu?
20160105 20:48:56 <zubzub> is it possible to delay it and do it in the gpu?
20160105 20:49:04 <zubzub> afaik that's what gpu's are good for no?
20160105 20:49:10 <zubzub> or does that require too much shader logic
20160105 20:49:17 <zubzub> or too much data transfer
20160105 20:50:30 <rmk0> it's not possible to do the multiplications as part of the actual rendering, because the number of shader invocations doesn't match the number of instances (for the multiplication, you'd want one per instance, but you'll get one per vertex instead)
20160105 20:50:50 <rmk0> but it might be possible to do the multiplications on the gpu, read back the result, and then pass that result in
20160105 20:51:10 <rmk0> i can't guarantee access to opencl, so i have to work within the confines of opengl 3.3
20160105 20:51:30 <rmk0> it then becomes a question of whether or not performing that step on the gpu screws up the later steps too much by stalling the hardware
20160105 20:51:46 <rmk0> it's quite a lot of data to send and then read back
20160105 20:52:28 <rmk0> er, "do the multiplications on the gpu in a separate step before the actual rendering"
20160105 20:53:04 <rmk0> instancing expects to consume a VBO full of precomputed matrices by design
20160105 21:04:42 <Eclesia> what about using a transformfeedback ? if the matrix if for the gpu in the end, could be a possibility
20160105 21:04:54 <rmk0> yeah, that's definitely a possibility
20160105 21:05:38 <rmk0> https://github.com/io7m/jtensors/issues/7
20160105 21:06:17 <rmk0> i'm guessing it's the overall number of memory accesses that's the problem... presumably direct byte buffers entail a larger number of native calls and bounds checks, for safety
20160105 21:06:45 <rmk0> reducing accesses by performing the multiplication on heap-backed matrices and then saving the result to a direct matrix negates the performance drop
20160105 21:07:24 <Eclesia> you could try benchmarking reading and writing for each type. looks like reading from direct byte buffer is your bottleneck
20160105 21:07:49 <rmk0> yeah, i have benchmarks for each type in there
20160105 21:12:11 <zubzub> 22:06 < rmk0> i'm guessing it's the overall number of memory accesses that's the problem... presumably direct byte buffers entail a larger number of native calls and bounds checks, for safety
20160105 21:12:15 <zubzub> yeah
20160105 21:12:18 <zubzub> each time for each byte iirc
20160105 21:12:27 <rmk0> heh
20160105 21:12:51 <zubzub> just have a quick look at the read and write operations of a direct bytebuffer
20160105 21:13:18 <zubzub> a whole lot of bounds checking
20160105 21:14:28 <Eclesia> another approach : consider viewing a ComputerShader as a classic Executor, but more like a MathExecutor where each cell/worker/unit (don't remember the exact name) perform a different operation. and do a single call for N operations. reusing in/out vbos over and over for various needs.
20160105 21:14:46 <rmk0> i'm targeting 3.3, i don't have them, unfortunately
20160105 21:19:44 <Eclesia> then resign yourself :D can't do any better
20160105 21:19:56 <rmk0> well, transform feedback is still an option
20160105 21:20:11 <rmk0> it does seem like reading is the bottleneck
20160105 21:20:12 <Eclesia> sure but makes the pipeline more complicate
20160105 21:20:18 <rmk0> the advantage there is that i don't need to read... ever
20160105 21:22:09 <Eclesia> won't be uniforms, need to push the values from vertex -> tess ctr -> tess eval -> geom -> frag. shader code less readable
20160105 21:23:09 <Eclesia> unless we can set a uniform value from a vbo ?
20160105 21:23:26 <rmk0> the matrices will always be coming from vertex attributes in this case, whatever method i use
20160105 21:23:59 <Eclesia> ... just thinking, what about UBO ?
20160105 21:24:35 <rmk0> not a fan
20160105 21:24:58 <Eclesia> never used them, don't know if it's really useful yet :)
20160105 21:25:08 <rmk0> don't think they are
20160105 21:25:36 <Eclesia> I don't use VAO either, does that boost the performances ?
20160105 21:26:51 <rmk0> someone tested this recently and concluded that it is an advantage
20160105 21:26:56 <rmk0> i'm now struggling to find the article
20160105 21:30:52 <rmk0> http://www.openglsuperbible.com/2013/12/09/vertex-array-performance/
20160105 21:37:52 <Eclesia> nice thanks
20160105 21:38:41 <rmk0> i moved to using one VAO per logical mesh, and haven't noticed any downsides yet
20160105 21:38:53 <rmk0> even if performance stays exactly the same... the apitrace traces are easier to read!
20160105 21:39:07 * monsieur_max (~maxime@anon) Quit (Quit: Leaving.)
20160105 21:39:16 <rmk0> reducing the number of gl calls is probably always going to be a win
20160105 21:40:50 <rmk0> i treat the vaos as immutable
20160105 22:14:35 <Eclesia> good night ++
20160105 22:14:43 * Eclesia (~eclesia@anon) Quit (Quit: Leaving.)
20160105 22:43:20 * badshah400 (~badshah40@anon) Quit (Quit: badshah400)
20160105 23:14:00 * badshah400 (~badshah40@anon) has joined #jogamp
20160105 23:43:02 * badshah400 (~badshah40@anon) Quit (Quit: badshah400)
20160106 05:05:15 -jogamp- Continue @ http://jogamp.org/log/irc/jogamp_20160106050515.html