« first day (1306 days earlier)      last day (2396 days later) » 

2:01 PM
hmpf, what would be the easiest way to see if an object is actually drawn on the screen? with OpenGL
Translate it's coordinates to screen-space and check if they are in -1,1 range in x and y axis
You can create a frustrum and translate it to world-space and check if the object is inside the frustrum
hmm I took kind of the first approach
Q: Is padding brackets objectively the best way to write C programs?

Benvoid Function( int, char ) versus: void Function (int,char) My friend keeps saying otherwise. What is objectively the best way to write brackets?

posting this again
and created a bounding box over the object
look at the answer
and OP's comment on the answer
2:03 PM
so it should work I think
and look at that 8k rep user answering that question
what is your motivation for not checking the z-axis in 3D?
I bet he also answers questions like "Does your mother know you're gay?"
Of course you need to check that too, but it's not in the -1,1 range
I think
I'm not actually sure :D
0, 1 for OpenDL
then somewhere my calculations are off
2:06 PM
@AlexM. What is that question doing in GD.SE in the first place?
I dunno man
And nobody has even pointed it out
Do I have to be that guy?
I flagged it
I flagged it too
more flags is always better
it's like he doesn't even know the rules
also god damn that
Oh, okay thanks. — Ben 47 mins ago
"Which is better, an apple or a pear?"
"Whichever you like best."
"Oh, okay thanks."
2:09 PM
don't get mad please :)
I'm not mad lol it's just very funny
I wish java had inbuilt support for vectors/matrices >.>
@skiwi No language has inbuilt support for them

I thought this was a sympthom
Except shader languages
2:10 PM
When you import the GameCircle Unity package, Unity will override existing files in your project with those in the package. Before importing the GameCircle Unity package, review the list of included files and compare this list with your current project to check for overlap. If a file exists in both your project and the package, verify that any changes you have made locally are backed up somewhere outside of your project.
okay, GameCircle for last.
I just couldn't expect Amazon to provide any better anyway
@Lasse I see ye... That's why I love shaders
Windows: click a window to get focus, move mouse down. expect to see window, have mouse pointer in middle
what I get: it locks cursor to top edge of window, now have window resized to half size.
it's this shit that makes me hate windows
regular occurances of crappy interfacing
oh and good morning guys :)
was the window maximized?
works well for me then
2:17 PM
this doesn't happen everytime
maybe one in 10
I'm not sure what you described there though
can you show a gif?
it's the first time I hear of that
I don't recall it happening, either
maybe it's something wrong with the window implementation in unity
I bet that's it, actually
but I haven't worked on Win 7 till now
or much unity
so they both started at the same time
and since it was a window issue, I assumed the culprit was... windows, naturally :)
fucking annoying though
hazard of coming in early
others come in when you're hitting your groove. they're not in groove, and do the morning talking.
honestly I'd do the same thing if I came in later :)
you mean like, when you're trying to work and still didn't wake up properly
and every fucking idiot is all noisy around you
talking about unrelated crap?
hahah :)
about like that
yeah I know that feeling :( not even headphones can fix it
2:22 PM
especially my headpohones, which don't block any sound
@Almo wheres the etymotics?
over there
but I use the Grados during work hours
so I'm not completely isolated from my surroundings
also, I don't have to take them off to talk to someone. I just stop the music with ctrl-F12 :)
there's a particular button in the bug genie (assign to self) that seems to not show up on certain issues, and I can't tell why.
you still like yours?
there's a general assign button and I can use that
but no quick assign to self
2:27 PM
I guess the bug tracker is...
... bugged
Hey there
I'm confused....
I see that an AABB can be used to check if an object is fully visible on the screen
But how can I check if a part of an object is visible on the screen?
apply only part of AABB /joke
2:46 PM
hmm I think you should check if a ray starting from that part and directed to your camera hits anything
3:00 PM
I just realized I paid $12 CAD for a name-your-own-price on bandcamp... and it's 3.5 hours long.
I was thinking, album... itunes... $9, I'll give him $12.
I got Everyday Matters on BandCamp, damn good albumn
$20 dollars worth at least, so that's what I handed.
given my usual listening habits
I don't quite know how to listen to this 3.5 hour thing
that's kind of a marathon
Still hating the fact that OpenGL ES 2.0 requires a 1:1 relationship with vertices, normals and texture coordinates. x.x
@MDavies What do you mean?
can some c# guy tell me what this is?

Color[] colors = new Color[segmentUnitCount];
3:15 PM
It's array
an array of objects of type Color
Looks to me like creating an array of unspecified size, but assigning it to a single value
of size segmentUnitCount
I think I get it
ok thanks
subtle differences from C++
think about Color[] like a particular type called
"array of Color"
3:16 PM
C# also has multi-dimensional arrays (Color[,] has two, for example), though I couldn't tell you if they're better or worse in terms of runtime and locality in comparison to arrays of arrays (Color[][]). Profile for yourself when you end up needing them, I guess.
ok thanks :)
@Lasse OpenGL ES 2.0 requires you to assign the same normal over and over again for each vertices. With regular OpenGL you can get away with having an indices buffer which indexes both the vertices and normals. But OpenGL ES 2.0 on indexes the vertices so you basically have to duplicate your normals.
Oh I can have multiple indices for one vertex?
In normal OpenGL I mean
Should I be embarrassed of how little I use arrays? I just like working with lists much better. The exception is when I can do some fancy index manipulation to get the logic down that I want. For example if I'm representing a grid then arrays make a little more sense logically.
3:21 PM
Use what works for you
If you've never had a problem not using arrays, then don't worry about it
that's my opinion anyway
Maybe I should use a dictionary that holds tuples instead or arrays :O
Not in that way, no. What I mean is you can assign indices for both a vertex and a normal. So:

OpenGL: v1/n1 v2/n1 v3/n1
0/0 1/0 2/0
Each vertices uses the same normal.
A: Rendering meshes with multiple indices

Nicol BolasIn the most general sense, no. OpenGL and Direct3D only allow one index per vertex; the index fetches from each stream of vertex data. Therefore, every unique combination of components must have its own separate index. So if you have a cube, where each face has its own normal, you will need to r...

It says there that using it like that it would decrease performance
It does but it is better for memory management.
Which is an issue I would think is more important on a mobile phone.
Who needs multidimensional arrays to represent grids when you've got Dictionary<Tuple<int,int>, SomeObject>!!!
3:24 PM
In my opinion, storing vertex data does not need to be optimized much, it's the textures that require the optimization
On mobile you anyway use less vertices
I don't even know if thats valid honestly..
Sounds good to me though
I do, but I want 100 models. That is going to be a lot of memory to manage.
100 is the least amount of models I want to work with anyway.
3:26 PM
I guess it's situational
I would swap a slight slow down in performance to having better memory management in this case.
But anyway, I didn't know one could use multiple indices for each vertex like that
@ToddersLegrande That better be a seriously sparse grid.
Every day something new :)
@MartinSojka I have my own ideas as to why but care to elaborate just to make sure I understand? :)
3:32 PM
Yeah, @Lasse I don't know whether they've changed it for the recent versions of OpenGL though. I wrote an object loader about 2 years ago that had it like that.
@ToddersLegrande Three reasons: First, Tuple is a class, so creation of one (for inserting and querying the values) is rather expensive. Second, Directory uses hashes to speed and generalise lookups, which means lookups are way slower compared to the two FMAs a two-dimensional array represented as one memory block has to do ((sizeX * x + y) * sizeOfValueClassOrStruct + baseAddress). Third, with an array you at least have a chance to keep all the data in the same memory block ...
Maybe it has been deprecated in favour of performance because GPU's don't have to worry about memory constraints as much?
Yeah GPUs nowdays has so much memory
@MartinSojka The second was the one I was pretty sure of. Hadn't considered the third one. I was thinking the first but wasn't sure. That being said, technically its all preoptimization :P
Good info either way. Thanks :)
But it is situational in the mobile domain I think. If memory constraints weren't an issue for the mobile domain I'd be more inclined to use a 1:1 relationship for my vertices and normals.
But as it stands you either want performance or memory and the memory option isn't supported. T.T
3:39 PM
tegra k1 fixes that ;)
Of course. That would be great if 99% of the mobile market ran Tegra k1. XD
Guess I'll have to find another way to manage the massive amount of data I want to work with until then, lol.
Just reduce the vertices, I don't think there are any other options for now
soundtrack drop
Thinking about it further since Tuple IS a class we would have to new Tuple() everytime we wanted to access an item in the grid... UNLESS WE STORE THE TUPLES IN ANOTHER DICTIONARY :O
There's probably a better way than using Tuples that still leverages a dictionary... I dunno
How about Dictionary<int, Dictionary<int, object>>? :D
3:45 PM
I could always sidestep the issue by only loading the objects that are really necessary. And load additional objects as they arise.
Don't know what kind of performance hit I'll get with that though, lol.
@ToddersLegrande Structs (they are values in C#, not objects) would be one idea. But, really, it very much depends on the data inside.
Well, one way COULD be using cull-based memory management, and only load those meshes which are seen on screen
But that's situational again
That seems highly costly.
It is if a lot of stuff changes on screen
It will be in one area.
3:49 PM
It is not that costly if you have like 20 objects on screen and move camera a bit and one or two more appears, which would be comparable to updating vertices of a lot of particles
Maybe if I move the camera back a bit and use low LOD models in the area where I have more characters.
That could work too
That's probably what I'll do then. That way if I use cull-based memory management I won't get such a performance hit, lol.
Which version of OpenGL would you recommend I start with? I'm using C++
The latest version, lol.
3:52 PM
3 or 4
I was planning on 3.3
You'll be fine with it
1.0 man
3 is okay I guess, avoid 2.x at all costs.
Oh definitely, avoid the fixed function pipeline :P
3:52 PM
It's been completely chucked out of the window. XD
Okay, thank you Lasse/M Davies
@TorbenC The latest your dev environment supports, or a revision below that if you really care about feature stability.
Right, not sure though, a lot of the mid-range graphics cards only support 3x
I've programmed with 2.x for a couple of years so it's been difficult to chuck that garbage out of my head and use a decent version.
Even if they support only 3.x they might still support some of the newer extensions that are core in 4
3:56 PM
Okay thank you :)
I think I'll stick to the 3.3 plan
(I believe it is the max my graphics card can support, not sure).
That's the case for my Quadro FX 880M, on which I am developing my deferred engine
I'd be happy to jump to GL4 but I just can't :(
Also, the performance is terrible, especially fill-rate
I thought the Nvidia GTX 500 series was now mid-range?
@TorbenC The Unity hardware stats would suggest about 15-20% can't run OpenGL 4 yet.
Wow, that's a small percentage.
That is good
That doesn't necessarily mean they can run it well. :)
4:00 PM
Yeah, I wouldn't think there are many GPU's that don't run 3x.
For mobile OpenGL, it's 85.2% ES2 and 14.5% ES3.
Probably none at all on any gaming PC
Is ES2 on OGL 2?
No, it isn't. :)
That's good :)
The OpenGL ES APIs are their own thing.
4:03 PM
Are they supported just like OpenGL or do you have to use a library for the ES?
OpenGL ES has come along much quicker than OpenGL.
What is ES? I know OpenGL SL is the shader language
ES stands for Embedded
S something
ES is embedded system I think.
What is the primary difference?
4:03 PM
ES is used on mobile
OpenGL ES was pretty much developed for mobile development.
Oooh I see
Cool, thank you :)
Different but similar feature set.
If you know one, you'll have little trouble learning the other, basically.
Cool :)
From looking at it I think it is much more grounded than OpenGL purely because a lot of development happens on mobiles these days.
4:05 PM
I'm excited to learn OpenGL and get out of SDL for rendering.
I still want to learn how to get input directly from an OS so I don't have to use libraries.
I wish the mobile platform wasn't as big as it is :( I like personal computers more.
@TorbenC It's a lot easier to create multiplatform games with SDL, and I'd recommend using it over OS dependant stuff
Oh for sure Lasse, it is more for learning what the libraries are doing to save me time
Educational ;)
Does anyone have spare time to explain me hwo to set up Shadow Mapping with directional lights, correctly?
Okay then :)
Thank you all for all of the help. :)
4:07 PM
@skiwi Just ask the question, someone might answer
It's more than just one question though... I'll try
I currently have a bounding box for my objects in world space
and I have a directonal light somewhere
how do I calculate the orthographic projection for that light? to use for shadow mapping
Which libraries are you using, which language?
Using OpenGL, furthermore LWJGL and Java(8)
Doing most of the things/calculations myself though
Have you tried googling "opengl orthographic light mapping lwjgl"
I don't see how that should give me extra answers, I've already used a lot of resources for shadow mapping
4:16 PM
You haven't exactly told us what you have tried
Also this sounds like something you could ask on the main site
Hence why I asked more a sort of guidance than a single question
What type of shadow mapping are you hopping to achieve? two-pass shadow mapping?
I will render one time the objects from light's point of view, then one time normally (user/camera point of view)
I think that qualifies as two-pass?
All the shaders etc. are all set up, literally the only thing to do currently is to actually calculate a bound orthographic projection
You'll have to translate your eye position to the light source and orientate the camera to look down at the scene. You then have to produce a map based on the z coordinates from the light source to get your shadow map.
Yes, I understand and got that working
I am at the part "to look down at the scene"
4:23 PM
You must have the direction vector from the light, right? Just lookAt with that
As when the calculations are not optimal, the shadows get very blocky, which is logical
You need to make a light projection matrix then?
Yes, correct
If the shadows are too blocky, increase resolution?
4:25 PM
new avatar joapet
I can easily come up with a matrix that surely encloses the whole scene... But not one that closes it as tightly as possible
@Almo yes, but not of free choice
you odn't need to ping me if I'm right here
you can usually tell by how recently i said something
But maybe you thought i was talking to skiwi
look at context. how could your response possibly be referring to what skiwi said
I'll do a ping like that if after reading the intervening text it looks like there could be a question
4:27 PM
What's wrong with using your old perspective matrix and applying it to the light viewmodel matrix?
Is that why you're getting a blocky resolution?
I suggest you have a look at that and look at the differences between perspective and orthographic. The matrix for both are given there.
An orthographic projection needs as input (left, right, bottom, top, near, far)
The projection matrix has always gone over my head slightly and I've always resorted to using similar triangles to get my perspective to work when I'm writing a 3D engine from scratch.
I am struggling on how to calculate this, such that the blocky-ness is the least, or put otherwise, such that I can use an as low as possible resolution
for the shadow map
4:36 PM
The left, right, bottom, top, near and far should be the same as your perspective projection. What is different is how the matrix handles these values.
In the link I gave you there are 2 matrices. One perspective matrix and one orthogonal matrix.
the same as my perspective projection... that is new to me
I've always read that the orthographic matrix has to do with AABB's
Well your viewing frustum shouldn't need to be changed, should it?
Hmm I'll summarize what I have
@skiwi Really? Where? It really has nothing to do with them.
All (left, right, bottom, top, near, far) defines is your viewing frustum (What sits in the camera's view) those values are then transformed into a projection matrix. At least that is how I understood it.
4:43 PM
(the term "orthographic" does, but an orthographic projection matrix isn't necessarily related at all)
camera, view: First person view (eye, roll, yaw, pitch)
camera, projection: Perspective (FoVY, aspect, near, far)

light, view: lookAt (light, origin, up_axis)
light, projection: ??
light, projection: (FoVY, aspect, near, far)
and if I put for light, projection an orthographic projection that certainly includes my scene, it works, but shadows are hopeless blocky
Just a slightly different matrix from your camera one.
so the light and camera's projection matrices should be equal for Shadow Mapping?
4:45 PM
@skiwi Blockiness is an artifact of shadow mapping.
No, as I said. Your camera is a perspective matrix. For the lighting projection you should use an orthographic matrix.
Increasing the resolution of your shadow map can alleviate it to some degree, at the obvious cost.
Generally to really "fix" it you need to use more advanced shadow mapping techniques.
Where do the AABBs come into play then? if I may ask
Gotta head off for a bit. I'll be back in a little bit.
Hope you get the help.
4:47 PM
@skiwi They don't.
Unless maybe you are talking about the AABB in light space that contains the scene.
and yes for [light, projection] I should use an orthographic matrix.. correct, then I am yet again stuck with how to calculate the parameters
But that's sort of an incidental issue.
Yes I actually meant that to calculate light space that contains the scene
And I am stuck currently on how to calculate such an AABB, such that I can construct the parameters for the orthographic matrix
This is an amazing article, and I think everyone should read it when they get the chance. It mostly has focus on politics but it's still related to games. Events related to games after the Sandy Hook Shooting.
5:10 PM
@skiwi You don't need an AABB.
The parameters to the method that constructs your ortho projection matrix are the top, left, bottom, right, near and far clip plane coordinates.
You just need to compute those. You should have most of them.
@skiwi I gave you the matrix for calculationg an orthographic matrix.
If you check the link I gave you right at the bottom of the page is an orthographic matrix for you to use.
blarg, finally looking at some spare time for game development this summer!
Dunno what I'm gonna do, but I've been wanting to make a Pokemon-alike simple RPG for Mobile ever since the iPod Touch came out.
5:26 PM
I was planning something similar yet different. XD
Gonna try to start simple, just getting some code together to render some simple stuff and handle inputs via libgdx on Android.
But I'm working on android.
Well yeah, droid is my platform of choice for now.
I can test the "engine" code on Droid.
I wrote a simple object loader and I'm rendering 3D objects right now.
I don't want 3D, I just want some simple top-down 2d stuff for now.
5:28 PM
Ah, no problem then, lol.
Gonna build off the Pokemon core concept: Team of mini-RPG characters that you collect.
Gonna start with the navigation system, followed by a rudimentary battle system.
Sorry had dinner, reading back up now
Mines a little more complex but I want to build it up to be a lot better than Pokemon anyway. Mine is probably more akin to Digimon World actually.
@JoshPetrie Can you please clarify that I should have most of those parameters? I have them for my camera space only, not for the light space at all?
They will be the same, @skiwi. All that is different is the matrix.
You've already defined your clipping plane(or view frustrum).
5:34 PM
The same as what? I'm using an fps view (eye, roll, yaw, pitch) and perspective projection (fovy, aspect, near, far) - Not using (left, right, bottom, top) anywhere else
or can I construct them?
You can construct your left, right, bottom and top from your fovy and aspect.
return frustum(x1, x2, y1, y2, near, far); found it in code aswell
then last doubt - should I construct a frustrum or orthographic matrix?
Apples and oranges.
There is a perspective projection function for left, right, bottom, top. You've used the overloaded version which just takes in fovy and aspect instead.
A frustum and a matrix are two different things; you can't assign a frustum to the projection matrix.
5:37 PM
You can compute a matrix from a frustum (or the other way around).
ok I see I can calculate the parameters
but what kind of matrix do I want as light projection?
Ok so that resembles directional light then
Check that link.
At the bottom of the page it gives you the matrix for an orthographic projection matrix.
Ok I see
5:40 PM
All left, right, bottom, top, far and near define is your frustums size. Those values get put into the matrix and the frustum is created from the matrix.
so Perspective and Orthographic are two different ways of looking at a scene. With respective respectively without perspective
perspective respectively*
Yes. An orthographic projection won't take into account perspective and as such the object will be the same size no matter how close or how far it is away.
I believe that is how it is anyway.
Is it logically valid to declare an orthographic method that takes as parameters fovy, angle, near, far? Or would that lead to immense confusion
Well fovy and angle would be values you need to pull apart to form left, right, top and bottom.
Your camera space function already does that under the hood. If you are to write your own function you will have to do that yourself.
Hard to tell if it's working now, as something weird is happening
I have a floor with a box on top of it
and the floor is half-lit half-shadowed
it's not shadow acne though
5:48 PM
Well I'm not sure what is going on there, lol.
Are you sure your light viewmodel is correct?
I'd say so
all I have is that this setup lightProjectionMatrix.identity().orthographic(-50f, 50f, -15f, 40f, 0.1f, 1000f); it worked
and only thing I changed now is:
`lightProjectionMatrix.identity().orthographic(fieldOfViewY, aspect, nearPlane, farPlane);`
so it should be coming from that calculation
and those numbers in first example were semi random
what is your light viewmodel matrix?
lightViewMatrix.identity().lookAt(new Vector3f(-20f, 7.5f, -20f), Vector3f.O, Vector3f.Y);
so from light looking towards the origin, as up vector Y
what you see in the image is (1) the floor, (2) a box, (3) rightmost view is the depth buffer, (4) next to that is the depthbuffer from point of light
and the lien at which the shadow "splits" is exactly the diagonal of the floor
And you're multiplying each point in the world by the LMV*LPM?
(need to get used to your notation)
but I think so ye
This is what I get when using those kind of random values
5:57 PM
Isn't that what you want? It looks right to me.
the (-50f, 50f, -15f, 40f, 0.1f, 1000f) are mostly randomly chosen
LMV = Light Modelview
LPM = Light Projection Matrix
that is the pont
and yea all points get treated equally
shader does not care which point is which :P
Well you can't randomly make a light projection matrix that is different from your camera projection matrix. :P

« first day (1306 days earlier)      last day (2396 days later) »