|
Members in Shoutbox
None.
Shoutbox Search
Shoutbox Commands
/w [name] > Whisper
/r > Reply to last whisper /me > Marks as action Shoutbox Information
Moderators may delete any and all shouts at will.
|
Global Shoutbox
Please log in to shout.
[2015-12-16. : 4:47 am] O)FaRTy1billion[MM] -- also send me the program when you're done, I wanna see it[2015-12-16. : 4:44 am] O)FaRTy1billion[MM] -- Although if you really want to get fancy you could make the shader do stuff, but I don't know if I'd be able to help with that since shaders are where I stopped doing stuff with opengl ![]() [2015-12-16. : 4:43 am] O)FaRTy1billion[MM] -- because without a shader, your original code of just glColor and glVertex would've worked immediately[2015-12-16. : 4:43 am] O)FaRTy1billion[MM] -- I feel like the biggest hurdle was (and is) that it's using a shader that really doesn't do anything and isn't needed[2015-12-16. : 4:42 am] O)FaRTy1billion[MM] -- ... or unless you had changed it since sending this to me[2015-12-16. : 4:41 am] O)FaRTy1billion[MM] -- unless int / float does some weird thing where it's always 1[2015-12-16. : 4:40 am] O)FaRTy1billion[MM] -- "red = (rand() / (float)RAND_MAX);" that looks correct to me ;o[2015-12-16. : 4:40 am] O)FaRTy1billion[MM] -- FaRTy1billionFaRTy1billion shouted: I did (float)rand()/RAND_MAX as my value, so that it is in the range 0.0 to 1.0 [2015-12-16. : 4:39 am] O)FaRTy1billion[MM] -- It might do that somewhere in some specific way, but it's best just to get used to 0.0-1.0[2015-12-16. : 4:39 am] Dem0n -- I thought I read somewhere it automatically changes 0-255 to 0.0 to 1.0, but maybe not[2015-12-16. : 4:38 am] O)FaRTy1billion[MM] -- Are their colors 0.0-1.0, or are you trying to do 0-255 again?[2015-12-16. : 4:36 am] O)FaRTy1billion[MM] -- Because typically changing states of things between begin/end is prone to breaking things[2015-12-16. : 4:35 am] O)FaRTy1billion[MM] -- I don't know, but if it's not working that is my best guess[2015-12-16. : 4:34 am] O)FaRTy1billion[MM] -- give me your paintGL code, it could just be the setUniformValue is set somewhere where it isn't working properly (like between begin/end)[2015-12-16. : 4:32 am] O)FaRTy1billion[MM] -- Except if the frag color set to a constant value worked, I don't see why the uniform doesn't work[2015-12-16. : 4:30 am] O)FaRTy1billion[MM] -- I feel like it was drawn with an array, and colors are passed as part of that array[2015-12-16. : 4:30 am] O)FaRTy1billion[MM] -- How does the code you originally took from this draw stuff?[2015-12-16. : 4:29 am] O)FaRTy1billion[MM] -- That's what I meant. In the one you sent me with gl_FragColor = vec4(1, .5, 1.0, 0.8);[2015-12-16. : 4:29 am] Dem0n -- nope, they were black before I specifically set them with gl_FragColor[2015-12-16. : 4:28 am] O)FaRTy1billion[MM] -- I dunno lol. Were the dots pink/a color before you started messing with the shader?[2015-12-16. : 4:26 am] O)FaRTy1billion[MM] -- layout( location = 0 ) out vec4 FragColor; ... gl_FragColor = vColor; That's weird O.o Try changing gl_FragColor to FragColor[2015-12-16. : 4:26 am] Dem0n -- and then wire_shader.setUniformValue(wire_shader.uniformLocation("Color"), colorVec);[2015-12-16. : 4:25 am] Dem0n -- In paintGL. I make a QVector4D which stores the rgba values of the specific Firework[2015-12-16. : 4:20 am] O)FaRTy1billion[MM] -- Since you're passing the color with a uniform, you'll need to set gl_FragColor to that value[2015-12-16. : 4:19 am] Dem0n -- okay it is drawing, but they're all black (wasn't showing up on black screen before)[2015-12-16. : 4:18 am] O)FaRTy1billion[MM] -- Dem0nDem0n shouted: wire_shader.setAttributeBuffer( "Color", GL_FLOAT, 0, 3 ); wire_shader.enableAttributeArray( "Color" ); Probably.[2015-12-16. : 4:17 am] Dem0n -- wire_shader.setAttributeBuffer( "Color", GL_FLOAT, 0, 3 ); wire_shader.enableAttributeArray( "Color" );[2015-12-16. : 4:17 am] Dem0n -- Yeah it's QVector4D, but still nothing is showing up on the screen. Maybe I'm not setting the rgba values correctly then[2015-12-16. : 4:17 am] O)FaRTy1billion[MM] -- did the original code by chance have you draw with an array or buffer? I think that's what all this 'in' shit is for[2015-12-16. : 4:16 am] O)FaRTy1billion[MM] -- if I could compile this I could probably help better xD[2015-12-16. : 4:15 am] O)FaRTy1billion[MM] -- otherwise you can always setUniformValue(int location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) xD[2015-12-16. : 4:13 am] Dem0n -- I'm trying to pass a vector in as the value for vec4 Color, but it's saying it can't convert that to GLFloat so like wat[2015-12-16. : 4:10 am] O)FaRTy1billion[MM] -- ok, then proceed with what you are doing. Maybe I'm not totally understanding in vec3 aColor;[2015-12-16. : 4:09 am] O)FaRTy1billion[MM] -- Before the fragment shader just ignored vColor and assigned gl_FragColor to some pink color or something[2015-12-16. : 4:08 am] O)FaRTy1billion[MM] -- because, unless I'm wrong, the vertext shader takes the color (in vec3 aColor;), and then assigns it to vColor (vColor = aColor;), and then the fragment shader takes that and, with the fix, assigns it to gl_FragColor which is then drawn on the screen[2015-12-16. : 4:07 am] Dem0n -- How does the shader interact with glColor? I didn't understand why the shader was like superceding glColor[2015-12-16. : 4:06 am] Dem0n -- yeah I did that, but I still need to be able to dynamically set vColor[2015-12-16. : 4:06 am] O)FaRTy1billion[MM] -- so with that changed, glColorwhateverf(numbers) should actually matter[2015-12-16. : 4:05 am] O)FaRTy1billion[MM] -- because the vColor is the color that has been passed along to that point, until the shader just threw it away by not using it |