« first day (944 days earlier)      last day (3987 days later) » 

12:00 PM
@jalf fair point, but some times 'chunkManager' is a better name then 'chunkLiftimeMaintainerLoaderUnloaderUpdaterAndCache'
 
Xeo
@thecoshman SRP? :P
 
'CanOfChunks'
 
@Xeo ?
 
Xeo
Single Responsibility Principle. Also, why not just chunkCache?
 
Hmm.. reminds me, must open some dog food.
 
12:03 PM
k = x++ || y++ && z++;
that's just ugly
 
@thecoshman But in that case, see my point about "what the fuck is that monstrosity of a class"?
If the most concise name you can think of which actually describes what the class does is chunkLiftimeMaintainerLoaderUnloaderUpdaterAndCache, then you should probably go back and split it into a million smaller pieces
 
keeeeeeeeeeeeel it
 
banning the word "manager" forces that problem out into the open. When the class can't hide under a convenient "manager" name, you actually realize just how bloated and complicated it is
 
yeah I take your point. In practice I would not have the chunk loading/unloading as part of the cahce, and the cache would probably not be doing much more then iterating over an STL container, telling them to update and checking if they can be unloaded.
 
@TonyTheLion yeah, I was just looking at that one
 
12:06 PM
@thecoshman and then you have a loader class and a cache class, and can name them after that, rather than calling them "manager"
 
true true
 
fuck managers
 
if I were the type to use terms like "code smell", I'd say that's exactly what manager classes are
It's not that they're necessarily bad, but they almost always disguise badness
 
omg are you still talking about managers
@thecoshman what have you done
 
I went for lunch, so yes :P
 
12:08 PM
Yea I made the trip to the other building for lunch
Open-air grilling... yummy.
 
@jalf Every time I see an SO question about 'Thread manager', I want to go hide under the bed and gnaw at the carpet.
 
I guess I have become a bit desensitised to 'manager' classes, they are everywhere at work... as are singletons ¬_¬
 
Shit, we've collapsed to 209-8 at lunch :((
 
though I have say @BartekBanachewicz 'MineField' is probably a worse name then 'ChunkManager', at least the later lets you know it is doing something with chunks :P
@MartinJames huh?
 
12:12 PM
uh no.
the chunks are irrelevant implementation detail
the interface doesn't give a slightest fuck about the chunk concept
 
@thecoshman Test match against the Kiwis.
 
@MartinJames ... cricket?
 
Uh it's only 4 days since sehe took a break and I miss him already
 
Yeah - Prior and Broad both ducked out.
Some bowler named 'Wagner' seemd to have done most damage. Sounds like a good name for a five-day test.
 
oh, you are still using the single texture file approach
 
12:18 PM
@BartekBanachewicz You should have taken more careful aim. Use a more powerful rifle next time to keep the trajectory flatter.
 
@thecoshman yes, I ditched instancing and instead construct each chunk as one raw VBO
it was the best compromise between speed of rendering and speed of recalculating.
 
@BartekBanachewicz huh? I meant the texture file... terrain.png, you have not moved over to a separate texture file for each texture, like the newer minecraft has.
 
@thecoshman no, I didn't.
right now I don't see a need for that.
I could use texture atlas, but then on mobile devices it would be a problem
and I am still keeping in mind the possibility of ES/WebGL version
 
well, if you wanted to add support for high res' textures I think you would have to, no? but yeah, if you have no intention of supporting that, single file works well enough.
 
define highres
I could use 2kx2k :P
 
12:24 PM
I mean beyond the 16*16 that minecraft normally uses
for the per-block texture res
 
right now it's 256x256 pixels
I could use 128x128 per block if I used 2048x2048 texture
 
oh?
but the individual tiles of the terrain texture are still 16*16 pixels
 
yeah. Now the only problem is using such a big texture of course
@thecoshman uh no.
 
I mean, they are subparts
that's 256x256 pixels, 16x16 blocks, 16 pixels per block
 
12:27 PM
is that not your terrain textures? are the individual tiles not 16*16?
 
it is right now
but I could load a bigger texture, still divided in smaller pieces
 
oh you could, but you can't just swap out that one image can you
 
you mean like without recompilation? Why, I can.
 
or do you have some other config files that maps 'smooth stone' to a certain part of the image?
 
no, I just use normalized texture coordinates.
<0,1>
if you move things around things will break as of now.
But I will move it to a separate file sooner or later
haven't decided yet if to use Lua or XML
 
12:29 PM
ah, so if you a certain block to be high res, you have to make the entire file high res?
 
yes.
each block has the same size.
it's a regular grid.
 
well, I guess that could work, as if you want one block to use highres, you probably want them all to
 
Point is it's simpler than using many textures
 
though separate texture files has one big advantage, as you just mention, you can just or remove one more texture, no problems
 
but it's slower to render or not supported and in general more complicated
texture atlas is a great solution but requires relatively modern OGL
 
12:31 PM
what's not supported? using lots of texture files?
 
no, texture atlas.
it's like, uh, an array of samplers.
I don't think it's supported on OGL ES
 
huh, sprite sheet, never heard it called texture atlas before
 
oh wait, maybe it is
@thecoshman that's not that, at least not exactly
In realtime computer graphics, a texture atlas is a large image containing a collection of sub-images, or "atlas" which contains many smaller sub-images, each of which is a texture for some part of a 3D object. The sub-textures can be rendered by modifying the texture coordinates of the object's uvmap on the atlas, essentially telling it which part of the image its texture is in. In an application where many small textures are used frequently, it is often more efficient to store the textures in a texture atlas which is treated as a single unit by the graphics hardware. In particular, becaus...
this is importatnt
 
@BartekBanachewicz it more or less is the same, one large texture image that you use a sub part of at a time
 
> The sub-textures can be rendered by modifying the texture coordinates of the object's uvmap on the atlas
@thecoshman okay.
 
12:34 PM
yeah... just like with a sprite sheet
 
well I guess we might have different definitions of "sprite sheet"
w/e doesn't really matter.
Well, if it's supported I will convert it to an atlas I guess
but that's not the priority ATM
 
what are you currently doing? loading parts of the file into multiple openGL textures?
or just one big texture?
 
one big texture
 
I don't know why, but spritesheets have always confused me.
 
@Pawnguy7 meh. These are quite easy IMHO. Especially in 2D
 
12:36 PM
@BartekBanachewicz and with a sprite sheet, would you consider it being loading to multiple OpenGL textures
 
I think it is because of the spacing used. Some have none, some haveone, etc. Although, that might just be including them in one image that isn't ready for use.
 
@thecoshman when using atlas it's not that simple. It's something in the middle, I think.
 
@BartekBanachewicz hmmm... perhaps I am missing something
 
@thecoshman texture atlas is made to get rid of the rebindings
so whilst composed from many images, it's treaded as a whole
 
still, I don't think that is some fancy modern openGL feature
 
12:38 PM
Wait, there are 3D spritesheets?
 
you have more or less always been able to do that AFAIK
@Pawnguy7 yes and no
think animated textures, more or less sprite sheets
@Pawnguy7 oh, and mind fuck, not all textures are 2d, you can get 1D and 3D as well :P
and more Ds I am sure
 
@thecoshman 4D aren't as common as 2D or 3D
 
Do you define 1D as like 5x1?
 
@thecoshman you might be right
@Pawnguy7 define "define"
 
12:40 PM
@BartekBanachewicz there isn't really a limit is there
@BartekBanachewicz well, I've used them with OLD fixed pipeline GL :P
 
@thecoshman in OpenGL? There is. You can't have 4D sampler
 
@Pawnguy7 more like just '5'
 
Well, how can you see a texture with only one dimension?
 
@thecoshman I might have confused them with UBOs and the technique used with uniform arrays
 
@BartekBanachewicz oh right, well I guess you would have to just keep swapping the 3D texture to simulate it.
 
12:41 PM
@Pawnguy7 by repeating it in one direction, for example. Remember that texture is just data
 
@Pawnguy7 might be something like a fancy gradient effect you want, one that is not simple to generate dynamically
 
If you mean something like a line texture that is repeated horizantally, I get that, but that has a width and height.
 
12:42 PM
I get what you mean though, I think.
 
user142019
I'll call Ø' std::all_of function "". :P
 
@Pawnguy7 and the width (or height) is equal to 1, not 0. It's a discrete data.
 
user142019
@StackedCrooked you can create multiple instances.
 
> Pre OpenGL 3.0... ... preference for texture atlases
 
> Core since version 3.0
Texture Array, not Atlas :/ My bad, I suck.
 
12:44 PM
@Pawnguy7 the data it self is just a line, but it 'smeared' into 2D texture
@BartekBanachewicz :P
 
I understand.
 
but those array textures do sound funky
 
> glTexStorage3D(GL_TEXTURE_2D_ARRAY, 1, GL_RGBA8, width, height, layerCount);
@thecoshman they are great.
 
but from the sounds of it, still not that great. doing an atlas (like you are currently doing) might be better
 
@StackedCrooked you have one instance per thread by default, so there's no single instance. And you can create more instances if you want to. :)
It might not be pretty (there's a lot about that class I want to fix), but it's not a singleton :)
 
12:47 PM
the main problem with a texture atlas, for something like you minecraft texture file, it is limited to 16*16 textures at 16*16 pixels, so there is a limit of 256 textures
 
Minecrafts water texture is a line I think.
 
no, it's a 16*16 tile that 'seamlessly' repeats
 
@thecoshman Who says textures can't be more than 256*256? Minecraft set the limit at 256 because originally it stored blocks as bytes.
 
"water-flow.png"
well
 
@Pubby yes, but to change that size is not a simple case of just swapping the texture file. The calculations for working out what sub sample is required would need to be updated. Sure it's not that complex a task, but is something that has to be done.
 
12:52 PM
there is the top texture..
 
¬_¬ you know you don't have to onebox every link
 
Oh. Right.
 
@thecoshman he could've rotated that one sideways :)
@thecoshman no, that's wrong.
 
@BartekBanachewicz or just not oneboxed :P
 
25 mins ago, by Bartek Banachewicz
no, I just use normalized texture coordinates.
so sub-sample stays the same if you just set up the 2x or 4x bigger texture
 
12:55 PM
@BartekBanachewicz yes, but that normalisation assumes you have 16 tiles in each row, if you make it 32*32 tiles so that you can have more tiles, you would have to update that code.
@BartekBanachewicz sure, but I was on about wanting to add more then 256 sub-textures
 
@thecoshman but we were talking about 16x16 tiles, but with higher dpi -.-
@thecoshman uh then yes.
 
8 mins ago, by thecoshman
the main problem with a texture atlas, for something like you minecraft texture file, it is limited to 16*16 textures at 16*16 pixels, so there is a limit of 256 textures
oh, I notice your console is a dequeue... it didn't occur to me that you might want to remove the older messages :P
 
though you would have to have a serious gaming session to clock up such a huge chat log that it becomes a problem :P
 
so I guess I am getting full code review? :3
@thecoshman or a shitload of autogenerated debug messages
 
12:59 PM
A merciless one
 
these are the best
 
why not a circular buffer of messages then?
 
@BartekBanachewicz ಠ_ಠ
 
@thecoshman that's pretty standard for hardcoding shaders
anything wrong?
 

« first day (944 days earlier)      last day (3987 days later) »