« first day (2119 days earlier)      last day (2908 days later) » 

7:02 PM
building anything large in QBasic will be hard since it's not object-oriented
 
Sie
Actually a Portal remake (a proper one) might work on the Xbox.
 
@Sie Why did you ask?
 
Sie
@AlexandreVaillancourt Curiosity and because you mentioned you were no longer a student.
 
Ah :) kk!
I enjoy(ed) school, but being a student doesn't pay much :P
And there are too much dumb and lazy ppl in there...
too many*
 
7:36 PM
Hi
Can someone help me with opengl shader stuff?
 
Don't ask if you can ask, just ask :)
If someone can help you, they will!
 
well
I mean if is there someone online, who knows opengl shader things
 
user4704
Just ask the question please.
 
:D
Okay
Can I paste code here in the chat with a tag like [code] code [/code]
well, I should upload it in pastebin for an example
 
Sie
Pastebin is fine.
 
7:43 PM
http://pastebin.com/fySLi4AT - shader.cpp
http://pastebin.com/WHXjM3q1 - main.cpp

The shaders:
vert:
#version 330 core

layout (location = 0) in vec3 position;

void main() {
gl_Position = vec4(position.x, position.y, position.z, 1.0);
}

frag:
#version 330 core

out vec4 color;

void main() {
color = vec4(0.78f, 0.33f, 0.12f, 1.0f);
}


So, I am working now 3 hours on making these shaders to work and they DONT!
The result should be a colored triangle..
The thing that now I think is do my graphic card supports opengl shader version 330 core
 
user4704
You don't do much error checking.
 
It supports
Well any suggestions how to do more?
 
user4704
Do you know the shader is built correctly? Do you know all your GL calls aren't setting GL error states?
 
Well, isn't that function:
glGetShaderInfoLog(shaderID, 512, NULL, infoLog);
handles every error, which shader cna have?
 
user4704
Almost any function in OpenGL can fail.
 
user4704
7:47 PM
You're not checking any of those.
 
user4704
What do you see?
 
user4704
Nothing?
 
user4704
Do you see the screen cleared to your clear color?
 
Yes
 
user4704
Yea?
 
7:47 PM
I see a screen colored in green
 
user4704
Change the clear color.
 
user4704
You might be surprised.
 
nothing?
again
 
user4704
(also, it won't affect anything but the first frame, but you should do glClearColor() and then glClear)
 
user4704
Do you know why I suggested you change the clear color?
 
user4704
7:49 PM
glClearColor(0.78f, 0.33f, 0.12f, 1.0f); // this is your original clear color.
 
user4704
color = vec4(0.78f, 0.33f, 0.12f, 1.0f); // this is your shader output
 
user4704
So even if you are drawing successfully, you'll never see it.
 
user4704
Because it will have exactly the same color as the background
 
You were right for that, but I changed the clear color in the shader, but there isn't triangle on the screen still..
also I changed these two:
glClearColor(0.78f, 0.33f, 0.12f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
like you said :)
the clear color of the .frag shader is:
color = vec4(0.33f, 0.72f, 0.25f, 1.0f);
 
user92578
Which one does it show?
 
user4704
7:52 PM
Make the shader write vec4(1, 1, 1, 1) for now
 
the screen is cleared in orange
 
user4704
Set glClearColor to (0,0,0)
 
and alpha 1, right?
 
user4704
Alpha is irrelevant.
 
ok
 
user92578
7:54 PM
^ use easy colors, (1, 0, 1) for maximum eyeburn
 
user4704
Unless you have blending on, which you shouldn't
 
user4704
you can use 1 for alpha though
 
user4704
just to be safe
 
user4704
In the vertex shader, set gl_Position = vec4(0,0,0,1)
 
user4704
Change glDraw* to use GL_POINTS
 
user4704
7:54 PM
Look for a white dot in the center of the screen
 
:D lol
well in glClear I should give alpha a value
because the function (the opengl's ) takes 4 arguments (r, g, b, a )
 
I'm trying to figure out what this is an inverse matrix algorithm : )
https://www.mathsisfun.com/algebra/images/matrix-inverse-2x2.gif
 
Where is that glDraw?
 
user4704
@sn0k3 glDrawArrays in your case I think
 
you mean GL_STATIC_DRAW
 
user4704
7:56 PM
No
 
oooh
yea yea
 
user4704
Basically, draw points.
 
Yes, okay
 
user4704
At a fixed location (0,0; the center of the screen)
 
Again..This time black screen
 
user4704
7:57 PM
So your failure is likely not in the shader (yet)
 
user4704
It's earlier
 
user92578
@DominicHughes doesnt look very useful
 
If you are curious window.render() just does glfwSwapBuffers(m_Window);
 
user4704
You may to find a gl debugger and attach that
 
user4704
or look into dumping glGetError calls after all your API calls to check things
 
7:59 PM
@Tyyppi_77 Well it's the best option I have, math is fun seems too understand how to teach people which is too provide them answers in a simple and efficient way rather then overcomplicating it and abstracting . : )
 
Gl debugger is a program right?
 
good maths is not complicated unless unavoidable.
 
gremedy.com that one?
 
user92578
@DominicHughes ever actually used 2D matrices?
 
user92578
(Hint: inverse matrices arent this easy in higher dimensions)
 
8:02 PM
Inverse matrixes are basically
when :
0 1
2 3
become :
-0 1
2 -3

I think.
 
user92578
That's kinda a weird way to learn them. Are you aware of the property?
 
0 1
2 3
becomes
-1.5 0.5
1 0
 
user92578
Also doesnt look right
 
@Tyyppi_77 you are right it is weird but I have to simplify it incredibly then build it up too a coding algorithm otherwise I'll get irritated immensly umm...

modelviewmatrix for mouse to ray picking?
 
@JoshPetrie any ideas?
 
8:05 PM
tkausl: I don't know how that works but okay.
 
user92578
These "helpful" tricks on 2D matrices are useles, except for giving you the concept of what inverses do
 
I know that lol .. gosh
 
user92578
So why bother?
 
user92578
gosh lol xd rofl jkjk
 
user92578
lmao
 
user92578
8:07 PM
@DominicHughes I'd guess by using the trick
 
user92578
gosh
 
8:19 PM
Okay screw it you guys win , I'll use a dam math library I hate everything that math has provided and designed it's the most stupidest way to understand the world I've ever seen ... it can be horrendously simplified also ..
 
@DominicHughes the inverse of a matrix is one that, when multiplied with the original, will produce an identity matrix.
 
@DominicHughes it's exactly the opposite. If you think it can be easier, contribute to humanity and publish a scientific paper explaining how
 
according to wolfram alpha...that doesn't produce an identity matrix bit.ly/1OUEmtA
stupid link parser
real inverse here: bit.ly/1WMTsUg
and proof of correctness: bit.ly/1TKrPcj
 
@NaCI I'll do one better develop an entire machine built on an extremely simplified design where possible.

But not yet I must first get my number one pet peeve -> money.
 
You don't need to understand how this math works
You only need to understand how to implement it
 
8:31 PM
I don't want to ever as well .
 
and what does what
 
yes I get that allright. thanks
thanks for the help people I'm gunna use GLM or Eigen I suppose done with this crap lol.
 
@IcyDefiance good with opengl? I mean enough to try to help to a beginner in opengl?
 
Don't know about eigen but glm is awesome
 
probably. I've played around with it for a few years.
 
8:33 PM
Oh..
 
tkausl: So far from what I've seen it's the heart of most tutorials.
 
Because there is one thing with shaders..Hm they dont work! :D I tryed to fix it, but..Asked here and Josh tryed too, but..
 
debugging shaders is hard. do you have an amd or nvidia gpu?
 
AMD
 
Jon
Lmao
Hold the door omfg
 
8:36 PM
what? :D
 
Jon
You watch the latest got?
 
no got in here please
 
No
 
some of has have not caught up yet
 
What happened?
 
8:36 PM
Fun fact: 2.9GB of windows icons, equals 4.222 icons.
 
I stopped watching it..
 
@sn0k3 I'm not really familiar with AMD's tools, but I think this is what you want for debugging: gpuopen.com/compute-product/codexl
 
Jon
I almost pissed myself at the big reveal
 
I just didn't liked the new season
 
Jon
Lol
 
8:37 PM
@Icy
@IcyDefiance thank you! :)
 
Jon
This season is reallllllly slow
But wow that last part of the last episode hahahahh
 
@sn0k3 your shader seems to be correct, are you sure the problem isn't somewhere else?
 
Jon
I'm curious if it was like that in the books
 
DH.
I stopped watching got in the first season, too much pron
 
It's better to be in the real world when working with anything then to be in overcomplicated and abstract maths need I say more.
 
8:40 PM
@tkausl I'm not sure..But where should be? Wanna all of the code in a .rar file?
tit's 4 files
 
yeah I don't think the shader is the problem either, but that debugger should help you find other problems, like if an opengl function throws an error
 
well.. you could've uploaded it to github but a rar works too i guess.
 
that is if you figure out how to use it, lol. I can't help there.
 
@tkausl any suggestions?
 
8:46 PM
@DominicHughes My name is still NaCL as in lemonade not NaCI as in idiot
 
@NaCl Sorry lol you have the weirdest name : >
I'll get it right now .
 
Thanks
 
@sn0k3 one sec, need to set up a dev env
 
@tkausl okay
 
It's not that I mind much, but if you try to ref me using @NaCI I won't get any annotation about it
Just press tabulator key as soon as you wrote @NaC and it should be fine
unless some super internet-troll comes online with the name NaCI, that would be actually quite hilarious
 
8:49 PM
The NaCi troll lol , hitler's back for another punch.
I'll be more logical : >
 
@tkausl here/
 
@DH. I share my HBO account with my Mom. I could see that she had seen about 10 minutes of first season recently. :P I'm guessing she had the same reaction, and stopped. :P
 
well
works now
did a few things
Not sure which one of these fixed it
Ah got it
So your first problem is
you bind your VAO to late
glVertexAttribPointer actually binds its data not to the global gl-state but to the VAO, so you need it to be bound before you call this
Just call glBindVertexArray right after creating it
@sn0k3 try this and tell me what you see
shouldn't be the expected result but one step at a time
 
9:07 PM
hm
tryed to change
like these:
GLuint vao;
glGenVertexArrays(1, &vao);
glBindBuffer(GL_ARRAY_BUFFER, vao);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(GLfloat), (GLvoid*)0);

glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
//glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(GLfloat), (GLvoid*)0);
glEnableVertexAttribArray(0);
but still the same result
nothing on screen
 
not that
..
call glBindVertexArray right after glGenVertexArray
oh wait, you tried to bind it as a buffer
what are you doing lol
 
LOL
I didn't bind vertex attrib array
 
vao is not a buffer
 
i mean vertex array object
glBindVertexArray(vao);
 
yes
 
9:11 PM
i did that after glBindBuffer(GL_ARRAY_BUFFER, vao);
and it worked!
 
well drop that line
you can't bind the vao as a buffer
 
you mean that:
glBindBuffer(GL_ARRAY_BUFFER, vao);
 
yes
 
why?
 
you can't bind the vao as a buffer
The VAO is not a buffer!
its an vertex array object
not a buffer
 
9:12 PM
aha
Dude, thank you!
Really!
 
You see a white triangle, right?
 
No :D
green :D
 
A green one?
Well i saw a white triangle
had to fix another bug
because you deleted the shader-programs after compilation. you should keep them at least till you linked them
 
Yes, but actually I've sent you other file or I've change it :D
but thank you!
wow, it was hard to debug that, wasn't it?
 
Not really
hardest thing was to set up visual studio with the correct link/includepaths and libs
 
9:19 PM
:D
What do you work on?
 
well, essentially the same
only a few more triangles and a few matrices here and there
 
are you learning opengl too? :D
 
I started learning ~2 years ago
So I know a big chunk of the basics
But there's always more stuff to learn
 
Especially in the new opengl
Got a quetion, should I clear GL_DEPTH buffer if my game is 2D
 
If you use depth-test then yes
but it shouldn't draw much performance anyway
so just clear it
 
9:25 PM
whoa
I dont come for 2 days and the chat looks different
 
different?
 
the background is white
 
still the same color
what
 
isnt it usually yellowish?
 
are you sure the graphics are loaded?
 
9:27 PM
other question you said that I was doing glBindVertexArray(vao) too late, should I do glBindVertexArray(vao) only once - when I create VAO?
 
its yellowish for me
@sn0k3 if your scene is that simple it should be enough, yes
 
or it should be every time, when I want to draw
aha
thank you
 
but for bigger scenes with more buffers you might want to use more vao's rather than using the same vao for all of them
 
lol i would take a screenshot to show ya rn but my printscreen button glitched out
 
Give example for more complex scene?
aha
 
9:28 PM
I essentially use one vao per model
because then I set the vao up with the correct vertexAttribPointers and I don't need to worry about the buffers anymore
anything needed to draw is in the vao
 
Well, I should do that 2 times
When I create vertex array object and the second time when I want to draw (in the main game loop)
if only once it doesnt wrok
 
If its bound it stays bound
until you unbind it or bind another one
 
user4704
It is quite rare that state you set in GL will become unset or otherwise altered by any action other than your own direct subsequent action against that state.
 
@tkausl LOL
when you said until you unbind it..
before the game loop there is:
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindVertexArray(0);
whcih does that - unbound
Thank you guys! :)
 
yeah
the buffer doesn't matter
you can unbind it
as i said, everything you need from there on is in the vao-state
but the vao has to be bound of course
 
9:35 PM
y :D
The thing was that part of that code was from a tutorial
and I just wrote it
but window and shader class were by me
 
Jon
what would delay a sound from playing?
 
user4704
Nobody being around to hear it.
 
hahahahahah
 
Jon
lol
 
I'm thinking I should setup a separate environment on my desktop for working. Reduce distractions and keep relevant things ready.
 
Jon
9:43 PM
you are really smart.
 
That explains why I feel smart.
 
Jon
does windows 10 do multi desktop?
 
yeah, try ctrl+win+right/left arrow keys
or win+tab and look at the bottom
the arrow keys might not work if you don't do win+tab first and click "add desktop"
 
Jon
cool thanks
didn't know that
now I can have a desktop for work, and one for play
 
9:52 PM
"1k lh on am" makes zero sense to me :D
 
1000 last hit on antimage... well it's not going to make more sense i guess?
 
10:11 PM
antimage is a hero?
 
yeah he's like a melee veigar, except the ult scales with the enemy's mana instead of AP and does aoe damage
I saw a video once where he killed 4 people with just the ult
 
Jon
pun intended?
 
@Almo it is
 
ok so you were antimage, and last hit someone for 1k damage?
 
@Almo i was not antimage (he was an enemy) and he killed 1k creeps
 
10:23 PM
... 1k creeps is a shitload, right?
 
i played as mirana in that game and got 400... my highest record ever is about 700
 
a high count in lol is like 300 or 350
 
Sie
So if this chat room were a picture what would it be of?
 
run it through .png algo and see
probably invalid data
 
do any of you guys by any chance have a program which takes a picture and prints out the vga signal responsible for generating it?
 
10:24 PM
not me
 
DH.
@Sie It could be a family one. With a guy in the background putting fire on the yard, because that would be mick
 
Sie
I'd still say XKCD sums us up pretty well...
Oh. I didn't know that worked lol.
 
How long do you reckon you could keep a pump like this going
 
Sie
Apparently posting an XKCD link will auto link to the comic. Neat.
 
Yeah, XKCD oneboxes*.
 
Sie
10:26 PM
That's convenient and it also supports the hover over text too.
 
It'd be awesome if their GIST oneboxing would get fixed.
As far as I recall, it's a problem with the API not with SO/SE, but I'm not sure.
 
DH.
But... gist are for source files, I don't think I would want that
 
DH.
Unless it was a cropped preview
 
Pretty sure it works just like any other pastebin'ish sites. :P
And it is cropped, with a scrollbar and everything. Much much cleaner than pasting code directly here.
 
DH.
10:31 PM
Oh OK
 
11:19 PM
@Sie Why do you obsess over doing this anyways?
 
You're wrong @MickLH. My opinion is much better!
It's obvious really. The color green is objectively the best color.
 
Sie
11:45 PM
@MickLH I try not to but admittedly I am guilty of it at times.
Still it's not like I'm the only one who is guilty of it. I've see guys in here get into arguments about OpenGL and best practices nearly every other day.
Anyway @Mick regarding that beam effect I was talking about earlier. Is there a reason why I'd want to use a billboard over a particle effect or something along those lines?
 

« first day (2119 days earlier)      last day (2908 days later) »