« first day (734 days earlier)      last day (4217 days later) » 

11:00 PM
Wow, I feel proud of myself. I could keep up with this conversation.
I'm getting better at this.
Soon, I will have rep to go with my newfound skillz.
 
uh huh
it's ok, I will always think of you as inferior to me
 
If I use glDrawElementsInstanced it allows me to get the “index of the current primitive” in the shader.
 
awkwardly steps out and lurks again
 
@daknøk Not sure why, but I think you can in D3D as well
 
11:13 PM
The documentation only tells it does that.
But the documentation is unclear.
It says the drawing is done N times, with gl_InstanceID (which can be accessed from within the shader) is increased from 0 to N - 1. gl_InstanceID is the only thing that changes.
So I think I have to read the buffer manually from within the shader, but that would be so weird.
 
agree
in D3D they pass the data in for you
 
In OpenGL usually they do that too.
// glDrawElementsInstanced has the same effect as:
if (mode, count, or type is invalid )
    generate appropriate error
else {
    for (int i = 0; i < primcount ; i++) {
        instanceID = i;
        glDrawElements(mode, count, type, indices);
    }
    instanceID = 0;
}
Makes no sense to me at all.
DOCUMENTATION Y U NO TELL ME WHAT DATA IS PASSED TO THE VERTEX SHADER.
 
harhar
join the dark side and use Direct3D
 
That would require me to use Windows. Meh.
I’d rather suffer from OpenGL than from Windows.
 
Windows isnt so bad...
 
11:21 PM
> The idea is that your vertex shader has some internal mechanism for deciding where each instance of the rendered mesh goes based on a single number.
 
gee, like, indexing into an array or something?
 
> It will send the same vertices instancecount​ number of times, as though you called glDrawArrays/Elements​ in a loop of instancecount​ length. However, the vertex shader is given a special input value: gl_InstanceID​.
@DeadMG ^ it seems xD
 
I owned my Web exam today I'm happy :)
 
gz
 
> gl_InstanceID and using instanced attribute arrays are the only mechanisms for being able to differentiate between instances.
But you cannot just read any buffer from GLSL.
I’d have to use a texture or something. XD
 
11:23 PM
instanced attribute array looks like what you're talking about
 
Ahh wait.
> It is possible to have one or more attribute arrays indexed, not by the index buffer or direct array access, but by the instance count. This is done via this function void glVertexAttribDivisor​(GLuint index​, GLuint divisor​);.
> This is generally considered the most efficient way of getting per-instance data to the vertex shader. However, it is also the most resource-constrained method in some respects. Virtually every OpenGL implementation only offers 16 4-vector attributes, some of which will be the actual per-vertex data. So that leaves less for your per-instance data. While the number of instances can be arbitrarily large (unlike UBO arrays), the amount of per-instance data is much smaller.
OpenGL y u suck.
 
.because shitty open Standard committee
 
Not sure if it's because I had OpenGL 1.0 class, but I found OpenGL 3.0 easier to get into than DirectX
Like anything microsoft they have typedefs for everything
 
yeah, but you don't have to use them
 
Also, Google sucks. google.com/search?q=opengl%20instancing no fucking useful results.
 
11:28 PM
and whilst DX's design is COM, it's still fundamentally object-orientated and quite a bit cleaner and more modern than OGL
 
@daknøk If so then y u no use Bing?!?
 
@Borgleader I USE DDG BUT DDG DIDN’T GIVE ANY USEFUL RESULTS EITHER!
 
ddg? ./me looks it up
 
DuckDuckGo
 
Yeah I googled it
I also used Cuil some time ago but it's dead now. Showed some promise
being run by ex-google employees 'n all
 
11:31 PM
I have too little bandwidth
 
11:43 PM
Man.
Fuck this shit.
 
it's interesting to look at the newest 10 questions and observe there's almost no correlation between age of question and number of views. (at least in that time span)
 
Do anyone here know how to implement properties in Visual C++ in the .cpp file with the prototype in a header-file?
 
@Alxandr what's a "property"?
 
Like, for instance; I have "virtual property bool IsReady { bool get(); }" in my header (ref class), what would I write in the .cpp file
Cause I can't figure it out, and it's probably stupidly easy, I just don't know how to do it -.-
 
@Alxandr nothing. In that case, you appear to have defined it in the header. Nothing goes in the cpp file
 
11:47 PM
No I haven't, there is no implementation
I need to implement the get-method
 
@Alxandr the implementation is { bool get(); }
 
No, it isn't. You missed the "property" keyword
The prototype is bool get();
 
@Alxandr yes I did. C++ doesn't have a property keyword
 
I wrote Visual C++
 
@Alxandr then the definition is "bool get() {return ???;}`
unless it's a member, then bool ???::get() {return ???;}
@Alxandr you mean Managed C++?
Visual C++ is an IDE
 
11:49 PM
Yeah, well, Managed is probably a better name
Or cl /clr
(which is what I tell the compiler xD)
 
@Alxandr I looked it up. Formal name is "C++/CLI" apperently
 
But no, it's not ::get() either
 
@Alxandr in that case it's too far from real C++ for me to answer
 
Yeah, I'm banging my head against the wall too cause of this...
 
here's the help page with a demo at the bottom: msdn.microsoft.com/en-us/library/yhfk0thd.aspx
 
11:51 PM
And I kind of don't want to inline them all
 
__declspec(property(get = getprop, put = putprop)) int the_prop; where getprop is a normal function.
 
Don’t use properties. Use public data members or don’t expose the data members at all.
 
@Alxandr it's 1:53am Saturday! What are you doing!
 
Found it :)
bool Album::IsReady::get
 
5 mins ago, by Mooing Duck
unless it's a member, then bool ???::get() {return ???;}
 
11:53 PM
Yes, but it was Class::Member::get
 
I’m going to do some benchmarking with voxels tomorrow.
I want to know at how many cubes it starts to lag.
 
@Alxandr huh. That's not what the help page says at all. :(
@daknøk 3
 
And daknøk, I'm using properties cause I'm writing a C++/CLI wrapper over a C api that is to be consumed by C#
@MooingDuck You're on the wrong help-page :)
 
C# doesn’t support public data members?
 
@MooingDuck Here's the right one: msdn.microsoft.com/en-us/library/ms235304.aspx
Yes, but as said; I don't have the data
 
11:56 PM
@MooingDuck 300000, maybe.
 
@daknøk dream on :D
 
I only have a pointer, and call into unmanaged methods to get the data (when needed)
Also, properties are the standard convention in C# (which is my target)
 
Well, depending on the resolution of the monitor of the player, the number of cubes to be drawn can range from a few to many.
So the drawing must happen very quickly.
All cubes are monochrome.
 
But thanks a lot for the help
The "C++/CLI"-name was what I needed to find the result on google :)
 

« first day (734 days earlier)      last day (4217 days later) »