« first day (513 days earlier)      last day (4427 days later) » 

6:16 AM
I wish some operators would be usable with operator->, e.g. it->[42]. (*it)[42] looks dumb.
Heh, if all postfix operators were allowed that'd mean p->->[42] would be legal.
 
6:32 AM
@LucDanton If operator[] overloads were properly commutative, you could do 42[*it] and avoid the excessive parens
If operator[] could be a non-member you could just provide it for the iterator in question.
 
That gets iffy considering that some proxy types return other proxy types that have an operator[] overload. So when you have proxy0[proxy1] which is indexing into which? A problem that the original commutative operator[] doesn't have what with the type mismatch.
 
->-> would be the double drill down operator?
@LucDanton I'm being a little facetious… I do wish operator[] could be n-ary and nonmember, though.
For what it's worth, overload resolution would probably handle most commutative ambiguities.
 
If the operator[] were written expressively to deal with it, yeah. In the current state of affairs I'd expect code to break.
E.g. Luabind: o["foo"][o["bar"]]
Both operands have same type.
Wait, no ambiguity when it's the same type and we have operator[](T, T) obviously. Maybe Luabind has such an operator, so let's make that o[o["foo"]] then.
 
To be really consistent, C++ should be synthesizing operator[] from operator+ and operator* when it's not provided… and to be anal-retentive, * should be a postfix operator like ->, and ^ in Pascal and MS CLI. That would solve many problems with parenthesizing (*foo)
 
 
1 hour later…
7:59 AM
@LucDanton Hey i seem to be having issues with memory in my puzzle problem using BFS, i'm using std::vector to hold strings which hold data regarding the puzzle.... is vector written into heap or is it possible for me to use heap space to solve more of the puzzle?
 
Can you play long for an instant and riddle me this: given std::vector<int> v(15);, what's sizeof v? What if I do v.resize(300), then what's sizeof v?
 
@LucDanton It claims both times it's the size of "20" (bytes?)
 
Right. The size of an object is a compile-time constant that is the same for all objects of the same type.
 
@LucDanton Same time? same type?
 
Fixed.
 
8:08 AM
@LucDanton Okay so how will this help me reduce memory usage
 
So given that, that doesn't leave much choice for what happens to the elements of an std::vector: they're dynamically allocated.
 
@LucDanton So it goes into heapspace not on the stack?
 
I just leave it at 'dynamically allocated' personally.
 
@LucDanton Okay. Would you mind terribly looking at my BFS loop and tell me if i did something wrong... i'm trying to solve a pretty small puzzle and yet it just doens'tt want to be solved
@LucDanton It's only a few lines
 
Go for it, but preferably on a paste site for nice formatting.
 
@ScottW how so?
 
@LucDanton sec, i'll add comments for u
 
@ScottW yeah, I'd be worried sick about colours too. Tell hem he won't see the ANSI sequence unless he pipes the output to another program/file :)
what kind of an artist are we dealing with (sry if I should remember)
 
@LucDanton Here you go: codepad.org/LnqaPt0z Fixed
 
@ScottW oh aha. mesh import/export? tristripping?
 
8:16 AM
@oorosco I think at the core your algorithm is either confused or relies on a lot of assumptions on the state of *this. It doesn't look like much of a BFS. I'd start over.
 
@LucDanton Assumptions? Just curious about thatt, and as for the BFS part, i thought that this is how one looked
 
For instance the newly computed states are put at the end of the queue while iterating over said queue. That sounds like using the wrong kind of loop.
 
@LucDanton THis is what one user showed me earlier : chat.stackoverflow.com/transcript/message/2905742#2905742
 
@oorosco For instance I find it suspect that the tree that is being searched is stored in *this.
@oorosco Notice how in this instance the queue is not stored in *this.
 
@LucDanton Where should i store the que then?
 
8:19 AM
@ScottW hehe. sounds like an awesome job
 
@LucDanton Create another class to hold a que? I thought it was essentially a stack which can be represented by a vector
 
@oorosco It's only use is to store some state while iterating over the search space, so it should be local to the search function.
 
@LucDanton So i shouldn't make it a global of the class?
Also how does that change anything?
 
It stops making no sense.
More seriously though, that queue doesn't start empty. Either that's not correct or you're relying on some assumptions which I can't comment on.
Start over with a local std::queue.
 
@LucDanton The que starts with a "start_grid"
the initial grid
 
8:23 AM
twitch Queue, not que.
 
@LucDanton What are the advantages of Qeue
queue
 
"Make things as simple as possible, but no simpler."
 
@CatPlusPlus how exactly is the this pointer handled internally if it isn't a const ?
 
Less of an interface than an outright container.
 
@IntermediateHacker By magic and series of mirrors.
 
8:26 AM
@IntermediateHacker 0 isn't const either.
 
@LucDanton I'm just extremely confused though as to why the location of the variable matters :O I'm sorry but i'm quite a huge novice in these matters
 
@oorosco Again, it makes things as simple as they should be.
The data structure has no use beyond that search. It shouldn't outlive it.
You don't put an int object in the global namespace every time you need an int variable, do you?
 
I think C++ is a headache for both the people who implemented it and those who use it. -_- . People only use it because there's no better alternative.
 
@LucDanton Okay i understand your point thought it was a different issue. I'm curious how would you arrange a BFS for a puzzle where the objective is to get a piece from the left side to the right side with various pieces in between which you can move in certain directions etc. That's the context of this, what would you consider a node to be expanded? I assumed for me that all pieces would expand to any posssilbe move that they could achieve (1 move per instance)
 
I'm afraid depending on the rules that this might explode really quickly.
Are the other pieces simply static obstacles or are there rules regarding how to avoid them or some such?
 
8:32 AM
5
Q: Why does foo = function() run the function in Python?

mattshepherdI'm up to Exercise 41 in Learn Python the Hard Way, and I'm having a really hard time wrapping my brain around the fact that the entire thing hinges on a function running just because it's been assigned as a value to a variable. I wrote up a little script to confirm that this is how it works, and...

I can't read these questions.
I tried.
I just. Can't.
 
@LucDanton Well each piece can either move vertically or horrizontally or both or none at all (static) The goal piece is the one objective and based on its movement capacity (horiz or vert or both) you might have to rearange pieces in certain fashions
@LucDanton I truly have no idea how to expand this into a BFS without it blowing up as you said which was my initial fear when i posted on here and got the first response about a generic BFS
 
All this belongs in the design/algorithm space, not the implementation space.
 
@LucDanton I never even seen such a space if you're refering to a chat room
 
I'm not.
 
@LucDanton What space are you refering to?
@LucDanton I have a Grid section which handles movement/saving data etc, and i have the BFS class which handles telling what to move where etc
 
8:38 AM
You don't need to ping me every time when there's so little activity.
 
0
Q: assignment operator c++ NULL assignment

gardian06I am working with a class that is mostly working fine, but I am doing some functionality that I might be having a recursive function return a NULLpointer of the class type as a control, and so it might be assigning a NULL pointer to my class object so long story short: Thing& Thing::operator...

Also known as: How many times you can say "const reference" and hear "but you can't copy null" before you explode.
 
Is there such a thing as Eternal March or what?
 
I'm just extra grumpy today.
 
Okay sorry Luc :/ i'm just used to using that ping :( I'm just tired and exasperated at this point because i cannot figure out how to get the BFS working -_-
 
@oorosco I can't find a explanation for the jargon so instead I will rephrase: you have a lot of decisions to take up front even before writing one line of code, and you have to especially make sure that any algorithm would be tractable.
 
8:45 AM
A huge problem with that is the fact that this expansion is absurd, running a 4x4 puzzle with 7 pieces is absolutely horrid
 
Brute force usually is.
 
@CatPlusPlus that's what she said!
morning :D
 
@CatPlusPlus I would use a better format but the assignment is supposed to be using BFS -_-
i have the environment setup and the methods of the algorithim working it's just that the way i have written it has a rediculous expansion.
 
@thecoshman That makes no sense. You blew it. And that's what she said.
 
@CatPlusPlus in her face!
I feel really sorry for this hypothetical 'she'
 
8:53 AM
@CatPlusPlus > *this = NULL; // compiler throws here
Lol
 
He edited it. It was this = NULL; when the comment was accurate.
 
So he's improving in the wrong direction.
 
can some on link me to a page with an overview of the different type of pointer classes, shared_ptr etc. My goolging is providing rather shit results
 
I would Google for "boost smart pointers" or something like that.
 
It's simple. std::unique_ptr is the one you should be using most of the time. It models unique ownership, i.e. there is only one owner of the object, and it's always responsible for destroying it, so the lifetime of the object is bound to the lifetime of the owner.
 
9:02 AM
ohai
 
std::shared_ptr models shared ownership — object is only destroyed when all of the owners are dead.
std::weak_ptr is not a smart pointer on its own, it's a companion to std::shared_ptr, and gives you the ability to store shared_ptr without increasing the owner count. OTOH, the object might die in the meantime, and your weak_ptr will be useless (but safe — it will never give you a dangling pointer).
 
what's been going in here?
24 mins ago, by Cat Plus Plus
I'm just extra grumpy today.
good to know this ^
better watch out for the grumpy cat :P
 
in effect then, dose unique_ptr provide garbage collection? so I have a class with member , of type unique_ptr, when this class goes out of scope, say it is only used in a function, what ever unique_ptr was set to point to, will be deleted for me, without me having to put a delete in my class destructor. badly worded I am sure :P
 
unique_ptr is simple, RAIIfied GC.
That's the whole point of smart pointers, that you don't have to destroy the object explicitly.
 
@thecoshman yes
 
9:06 AM
shared_ptr is more complicated GC scheme, it's refcounted.
And you can't really predict when it's going to die.
 
shared pointer would be handy for something like... a SQL connection? many class can share this connection, and once they are all gone you can close the connection...
 
Yeah, maybe.
 
probably not the best example :P
so, what other do-dads are there?
pointer wise that is
 
That's it.
 
@thecoshman You've been hanging out here for longer than I am. You should know this already :)
 
9:15 AM
@StackedCrooked #java
¬_¬ not sure why I put that as a hash tag, damn twitter
 
There's a proposal for value_ptr, but haven't really payed attention to that one.
I'm going to class to write Java now.
Shoot me.
 
@CatPlusPlus and for some kind of reflection-enabled smart pointer, I believe. Can't remember its name now.
 
Also friggin' set-top boxes again.
 
@CatPlusPlus huh
 
"Embedded Systems". Pfft.
 
9:22 AM
lol, I found out.
 
@CatPlusPlus yeah, where every byte counts ... sort of :P
 
@thecoshman some from Boost, some from other libraries. e.g., working with OpenCV you'd use OpenCV's own Ptr. so on. With Boost you have in particular boost::intrusive_ptr, where you can design your classes to support sharing. More efficient.
 
@CheersandhthAlf I was on about std::<something>_ptr but that's good to know
 
I just created a no_idea_what_happened_exception. :D
try { ... }
catch ( const no_idea_what_happened_exception& e ) { std::dont_give_a_fuck(); }
 
9:38 AM
> In some compilers (for example GCC), pointers to C++ instance methods can be directly cast to a pointer of another type, with an explicit this pointer parameter.
wut?
doesn't that violate aliasing rules?
In many object-oriented programming languages, this (also called self or Me) is a keyword that is used in instance methods to refer to the object on which they are working. C++ and languages which derive in style from it (such as Java, C#, and PHP) generally use this. Smalltalk and others such as Object Pascal, Python, Ruby, and Objective-C use self; Visual Basic uses Me. The concept is the same in all languages. For brevity, here we just say this. this is usually an immutable reference or pointer which refers to the current object. Some languages, such as Objective-C, allow assignment t...
from this article ^
 
Visual Basic uses Me ? That's stupid.
 
@IntermediateHacker could be use, image if it use 'i'
 
you know, if I were to design a language, I'll use something like *..
for example this->method() will become *.->method()
 
@TonyTheLion a) aliasing rules may or may not be more about simply casting to another type b) this is about some implementations, not the language c) aliasing may only apply to object types, and functions and member functions are not objects.
 
@IntermediateHacker just to be awkward?
 
9:47 AM
@LucDanton ah I see
 
@IntermediateHacker Surprise. It original, for one thing
 
int ::main:: [int argc][string argv]
=[]=
::print::["Hello, World!"]
=[0]=
 
@IntermediateHacker what?
 
^ syntax I came up with, its weird but may solve some problems.
 
@IntermediateHacker what problem? that you find code to easy to read?
 
9:59 AM
its just difficult to read because you're not used to it.
    using classes:
    _class_ ::my_class::[int arg]
    =[]=
    /* constructor code */
    =[]=

    /* methods */

   _class_ /* end */
 
hmm how would this (void)L; make sense on a line by itself inside a C function, when L is a pointer to a struct ?
 
@IntermediateHacker No, it's unreadable because it uses all kinds of weird characters
 
@TonyTheLion It's a way to silence compiler warnings about unused variables.
 
casting to void just throws away the result of the expression, so the compiler won't warn that it's unused
 
I find it useful in situations like these:
Result * result = get_result();
assert(result);
(void)result; // avoid compiler warning when NDEBUG is defined
 
10:09 AM
ah ok
makes sense
hmmm
 
is void main() correct standard c++?
 
nope
should be int main(int argc, char** argv)
on X86-64:
> Because the full 32-bit instruction set remains implemented in hardware without any intervening emulation
I had no idea ....
 
main returns int, although there is some fluffy wording in the standard about allowing additional implementation-defined entry points, which could allow void main()
@TonyTheLion int main() is legal too
 
right
 
@jalf Not so sure about those additional entry points (apart from freestanding implementations). Which is a bit weird as that differs from C IIRC.
 
10:22 AM
@LucDanton yeah, I can't remember the exact details
so I might be wrong :) In any case, just write your damn main correctly :)
 
@jalf no, main must have int result, but other entry point is allowed for free-standing implementation (such as, one must presume, Visual C++)
 
@CheersandhthAlf Gave me a good chuckle.
And I barely know or use the implementation, hah.
 
@bamboon no, it has never been valid C++ or C. that's in bjarne's faq.
 
@CheersandhthAlf ok thanks, I just read it somewhere and wanted to know what I should think about it
 
10:41 AM
@CheersandhthAlf in other words, standard C++ must have main return an int, but not all C++ is standard
 
that article
my head
 
@awoodland It's written in a Domain Specific Programming language :)
ComputerMafia++
Or something.
 
well that would be quite an interesting result
if that were provable
since it has significant implications about skills/resources of the authors
 
10:48 AM
@LucDanton exactly :P
 
Aren't there hundreds of obscure little programming languages out there?
 
I am sure there are
there are probably as many obscure languages as there are people who don't know how to use a library
 
how many of them just output C and hand it off to MSVC on windows?
 
HLA is an interesting suggestion.
 
10:56 AM
Whoah, if I do 15_mus.count() then GCC complains that there's no operator"" _mus.value. Now I want to check what kind of name is allowed for UDL operators.
identifier-nondigit:
    nondigit
    universal-character-name
    other implementation-defined characters
Well that's convenient...
 
11:13 AM
0
Q: Is a Conversion Operator Valid in this Case?

IntermediateHackerUsually, books usually discourage the use of conversion operators when wrapping up c structs. For example the c++ string, which is (believed to be) a wrapper of a C char array, does not provide a conversion operator. Instead it gives the the method c_str(). However, I seriously think my case ma...

 
That's funny, I'm using Boost.Units which wraps an underlying type in a neat unit-aware object (a quantity). And I have one of those objects as a member of a class. So if I want access to the underlying type of the quantity of one of my object, I have to do o.value().value().
And I'd still rather have that than conversion operators. Of course, I could use a better name for that first value, but I've spent too much time worrying about that already.
 
@IntermediateHacker I think that for the sake of clarity, it is best to have a toSDL_Surface() function, very clear what you are doing then
 
@thecoshman yeah.
 
@thecoshman or just to_SDL() to prevent repeating yourself (beware of conflicts with inheritance)
 
@sehe yeah, what if I declare a virtual to_SDL() and override it for all children. All classes in fact.
 
11:23 AM
@IntermediateHacker It will work, as long as you don't want to separately be able to call the base to_SDL implementation on occasion
 
11:35 AM
@IntermediateHacker FYI, encapsulating something like SDL so that some one who uses your library is unaware that it is actually just SDL + some handy shit is not just a java thing, it is good practice
 
@thecoshman but doesn't java do something similar in Java2d? :D
 
@IntermediateHacker my point is, encapsulation is good design practice
if I make a game engine, as I am doing, one of the key goals is to design it so that the internal openGL madness is hidden, but at the same time accessible for those who really want to fuck with it
 
@thecoshman yeah, I agree. I've accepted that guy's answer. But it doubles my work, though. Now I'll have to write a couple more wrapper classes.
 
No one said doing the right thing was easy
generally speaking, the more you bust your balls making your API/library, the less the users will have to
 
if you're making a game engine without a game, you're basically wasting your time in any case :)
no one's ever done that and ended up with anything usable
 
11:41 AM
I know well the theory of 'make a game, not a game engine', but I am very slowly working on it, currently still on the basic can't really see any thing for my work stage
 
er, not trying to be a smartass or anything, but I'm not sure I see how that changes anything
are you saying that it's ok to work on a game engine instead of a game as long as you do it really slowly?
 
no, I am saying I am not just making a game engine. I am slowly working towards a game, but I am writing my code with re-usability in mind and that I am currently at a basic stage where it is fairly simple to write as a reusable class, as it is very basic openGL features I am wrapping, such as vertex buffers
extended that example, I am not trying to write a one for all vertex buffer class, I am adding in what I need to get basic objects rendered, but also ware that it is easier in the long run to be aware of what I could add in
right now, I am just wanting to get single triangles done, but I know I will soon want to be able to use strips and fans etc.
 
@thecoshman Have you looked at existing OpenGL wrappers (like oglplus)?
 
@thecoshman well, that's kind of the point. Don't do that until you need it. Make it usable before you make it *re*usable :)
you don't need to both wrap ogl and make it accessible to someone who wants to bypass the wrapper
I'm also willing to bet that you won't need either strips or fans. They're only really marginally useful in some very specialized scenarios. Mainly, they're a remnant from ye olde days when gpus were much more limited
 
12:00 PM
@thecoshman: the thing is, there is no such thing as a generic game engine. Yes of course, you can create some utility libraries like high-level GPU wrappers. But as soon as it comes to many functionalities you'll conclude that games differ to great.
 
Stevey posted a new blog post.
 
take scene managers for example, you'll want something completely different for FPS, RTS or platformers
 
@StackedCrooked Stevey?
 
Steve Yegge but apparently it's not written by himself (according to the introduction).
 
oh right
 
12:04 PM
Actually, I think he did write it. Dunno how to interpret that 'Editor's note'.
 
12:36 PM
ok
I went to sleep, I woke up, and my rendering code still worked first time
 
Good afternoon.
 
@jalf From my knowledge, current GPU drivers will often convert lists to strips internally
 
@DeadMG kind of, afaik. But they're designed to do so very efficiently
 
I expect so
 
fixed link
on triangle strips
 
12:47 PM
lol
hmm
apparently I can go up to 10k of my 10vertex ships at once
but 1million is a few too many
100k is like, 2FPS
 
1:03 PM
that doesn't sound too great to me...
 
depends on how crazy shaders he is using :)
 
What are the usual metrics to measure GPU capacities regarding geometry? And are those useful?
 
but sounds plausible to me. That's 10k state changes since you need to push a new transform matrix for each, at least
 
@LucDanton most people just plum (foolishly) for fps
 
Should I pass an std::function by value or by const reference?
 
1:07 PM
@thecoshman Useless if not correlated with the amount of geometry in the first place.
@daknok_t It works out exactly the same (which mean getting the usual problems in both cases).
 
@LucDanton fillrate, polygon count/s, fps, ... . It actually mainly depends on which rendering stage you talk about.
 
Well, most simple metrics are kind of pointless these days. You can count triangles per second or something, but that's worthless because a triangle isn't just a triangle. Depends on the shader you use, on how well you can batch the triangles, on fill rate and overdraw and so on
 
@LucDanton So passing it by const reference won't bring any other problems, right?
 
Thanks a lot for all the info guys.
 
yeah, there are a lot of things that could be measured and that can change, so it is very hard to really get a solid idea of performance
 
1:11 PM
@daknok_t Nope. As usual though if you need to store the object then passing by value is preferable, that bit is not specific to std::function.
 
Thanks!
The only thing that is done with the function is calling it. I'm implementing static if.
 
@jalf I don't really get what he means with vertex/triangle in the indexer case?
 
erm... fairly sure this article is saying use strips, just don't spend four months processing geometry data just to make it use one less index
the idea of triangle strips over triangle lists is that you can index you data with roughly half the number of indexes, which with a large model can be a sizeable reduction in indexes
 
@thecoshman And as indices are usually only 2 or 4 bytes this space "win" is most likely negligible compared to most other processing in the GPU
 
@KillianDS perhaps it is just me, but I would have my game geometry stored in a format that closely resembles, if not mirrors, the format that is used internally. in other words, pre-optomised
the same goes for something like mip-maps, though mip-maps are fairly cheap to process, but if you want some hinting with them, say making certain details more sharp at lower resolutions. yeah I know, some one missed the point here, but still
 
1:23 PM
For static geometry? Reminds of point clouds.
 
@thecoshman what would gain you that? Most likely your triangle strip representation will be far from the internal usage. But you do have to take care of the problems with strips (like primitive restart).
@thecoshman That is all about mip-map generation, something you most likely will even do at skin creation time, not at runtime, because you're talking about tweaking individual mipmap levels.
 
@KillianDS yeah, I started to use it as a comparative analogy, but sort of got side tracked :P
@KillianDS I mean, I would store my file format in a way that can be loaded almost directly, perhaps a few markers to say where the individual strips are. The other solution would be to use a common format, and process it each time you load
 
@thecoshman no, it's saying index your triangles, but put the vertices into your vertex buffer in a sensible order
 
@thecoshman Yes, I understand that, I also use some simple container format to store raw model data that resembles my drawing setup. However, I don't see how that is an argument to use "triangle strips" over "triangle lists"
 
@jalf I must have mistook your purpose for linking to it, I thought you where using it to show why you wouldn't bother with triangle strips
@KillianDS it's a more a counter-argument to the idea that strips take too long to process and so you should just use lists
 
1:31 PM
@thecoshman but I don't see the argument?
 
@jalf well, that goes with out saying doesn't it. in an ideal world, your vertex data would be used from one to N
@KillianDS now I am confused who is saying what about what :P
 
@thecoshman well, I am. Don't bother with triangle strips. Of course caching matters, and the order in which your indices and vertices are placed into the buffer matters, but you don't really gain anything by calling drawtrianglestrip() instead of drawindexedtriangles()
 
@thecoshman You're defending strips, right? what is your argument to defend them over simple indexed lists of triangles :P?
 
@jalf well, I would argue that you do, but I will have to simple say that I would have to actually test this out
 
with an optimal triangle strip, you have to place one vertex in your vertex buffer for every triangle. (the other two vertices are taken from previous vertices in the buffer). With half-decent indexing, you can get more mileage out of your vertices, drawing more than one triangle per vertex in the vertex buffer
at the cost of specifying a few more indices, but indices are so much cheaper than vertices
@thecoshman or you could trust those who (1) work professionally with high performance computer graphics, and (2) have tried it out and described their results ;)
 
1:35 PM
@jalf don't forget that with a non-optimal strip (which is often the case) you need mltiple draw calls or need to insert primitive restart indices into your index array. So even that argument isn't that solid
 
@jalf I could do... but where is the fun in that :P
 
@KillianDS well, I did say "optimal". Non-optimal triangle strips (which, as you say, are much more common) will fare even worse
@thecoshman in actually ending up with code that's usable in a game?
@thecoshman point is, if you can't even theoretically describe a scenario in which your approach could be more efficient than the alternative, then there really isn't much to test out
just like you usually don't need to test whether performing 10 additions might just be faster than performing 3
 
Seriously, I get a bug report for a tool that I created that libstdc++.so cannot be found, I really don't want to know how old the machine is he tries to run this code on
 
@jalf situations where you have a strip of triangles or an area that is a regular(ish) grid
I take your point that not all geometry should be done as strips, but that is why there are different ways to index geometry
 
@thecoshman no, it is because most of them were invented in 1980
 
1:44 PM
@thecoshman In a nice grid you'll often see that triangles are spread over up to 8 polygons, in which case indices are likely much more efficient than triangle strips.
 
and graphics hardware back then worked differently, and sucked at a lot of things that can be done efficiently today
 
this one is a great example of that for opengl/GPU's
115
Q: Once upon a time, when > was faster than < ... Wait, what?

Armen TsirunyanI am reading a wonderful OpenGL tutorial. It's unbelievably great, trust me. The topic I am currently at is Z-buffer. Aside from explaining what's it all about, the author mentions that we can perform custom depth tests, such as GL_LESS, GL_ALWAYS, etc. He also explains that the actual meaning of...

 
@thecoshman nope, still the same: a perfect strip allows you to specify one triangle per vertex (minus a few vertices lost to starting up the strip and such)
in other words, each vertex will be reused for (at best) 3 triangles. But if we assume a rectangular grid, then each vertex will actually be a part of 6 different triangles, so with a vertex strip, the same vertex would have to be stored multiple times into the buffer, and transformed multiple times
 
ah, I see more what you are getting at
 
if you just store a list of indices, and draw plain old indexed triangles, then you only have to process each vertex once, and it can contribute to as many triangles as it needs to
 
1:50 PM
you are saying that in order to allow strips to be processed fast, you would probably have to duplicate vertex data, other wise you could end up with cache misses
 
@thecoshman no, in order for them to be processed *at all. The entire point in a triangle strip is that each vertex defines a new triangle, by implicitly reusing the last two vertices
This means that each vertex is only used 3 times before your "window" moves past it
 
we need a drawing board to explain this
 
if you want to reuse it for a fourth triangle, then, well, you can't
 
but a vertex can be used more then once in a triangle strip
 
@thecoshman yes, but at most 3 times. Once for creating a new triangle, and twice for the triangles folowing that one that are re-using it.
 
1:52 PM
the only 'window' I can see is a small cache of part of the vertex buffer
 
@thecoshman but not more than thrice(unless you use multiple draw calls or other workarounds to break up the strip and basically restart it)
If you have a buffer containing vertices v0, v1, v2, v3, v4, v5, v6 then it defines triangles (v0, v1, v2), (v1, v2, v3), (v2, v3, v4), (v3, v4, v5), (v4, v5, v6), yes?
in other words, each vertex is only a part of (at most) 3 triangles
 
@jalf no... lets say you have a regular grid of vertices, your strip can run back and forth along the grid
 
@thecoshman yes, but the vertices will actually be recalculated.
 
@thecoshman I'm not talking about vertices in your grid, but vertices in your buffer
 
@jalf in the example yes, but there is nothing stopping you from using v2 multiple times in you index
@jalf I think you me indexes in your index bufer
@KillianDS what do you mean? passed through the shader more then once? AFAIK, if you use a vertex multiple times in a triangle list, for each triangle three vertices are sent through the vertex shader, even if it is identical to a previous one, the data is not cached, there is no "oh, I say his exact data just a moment ago, I know what it should look like"
 
@KillianDS :O well that put me in my place
yeah ok, strips are looking kind not look worth the effort any more
is that something that is automatically used when it can? or do you need to enable it? what version? questions!!!
 
It's actually not something standardized but I'd be surprised if you can find any serious modern GPU that does not have it. As the article says, as soon as you're using indexed rendering you're most likely using it.
However, like any cache you can optimize it by improving cache hits, as is also explained in the link over there :)
 
yeah... you probably could have shut me up from the start with that link :D
 
Pf, factual evidence is overrated. ;)
 
@jalf citation needed!
 
2:10 PM
@thecoshman it's just a hardware feature which is on whenever possible. You can't disable it explicitly (although you can structure your rendering so that it doesn't have any positive effect, with a bit of effort)
 
@jalf now that would be stupid :P
 
sigh
my brother is harassing me over these motherfucking Android images again
 
is it a younger brother?
 
he knows I haven't fixed anything up but ordered 40 of them anyway
no, older
 
ah, that's tricky. Younger brothers are easy to put in their place
older brothers are always right, by definition
so suck it up and do whatever it is he wants
<- is an older brother
 
2:13 PM
did you ever, ever know me to accept that?
 
@jalf not if you move out of the country :D
 
@thecoshman no, always
 
@jalf not if you move out of the country >:(
 
@thecoshman says the little brother...
 
@jalf out of the country, I win :D
 
2:16 PM
well, considering that I'm hundreds of miles away, my older brother can't bother me in person anymore
which is pleasant
 
and I'm not just a little brother, I am a middle child :(
 
but it's still unpleasant to have him come along and bother me - again
 
@DeadMG try moving out of the country, works a treat :D
 
and, what the fuck is gonna happen if something goes wrong?
I can't fix his Android devices from 200 fucking miles away
 
@DeadMG his problem :D
 
2:20 PM
lol
 
"out of the country" :D
 
I don't even have an Android device to test it on
 
I refer to my previous comment about who problem it is :P
 
lol
true true
 
2:45 PM
@awoodland it is very simple: it's a C-based framework. e.g. I worked with one silly such framework ("AC Foundations") in Andersen Consulting. probably IBM?
 
2:58 PM
sugartime
 

« first day (513 days earlier)      last day (4427 days later) »