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:01 am] O)FaRTy1billion[MM] -- But I still say just pass the color with glColor and the fixed shader[2015-12-16. : 4:00 am] O)FaRTy1billion[MM] -- so thing.setUniformValue(thing.uniformLocation("words"), yourValue);[2015-12-16. : 3:59 am] O)FaRTy1billion[MM] -- http://doc.qt.io/qt-4.8/qglshaderprogram.html#setUniformValue lol it's because it's got a ton of variations that alternately take the string or the int[2015-12-16. : 3:57 am] O)FaRTy1billion[MM] -- like if you had vertex, texcoords, bumpcoords, or other shit[2015-12-16. : 3:56 am] O)FaRTy1billion[MM] -- It's so you can specify the format of your shader's input[2015-12-16. : 3:56 am] O)FaRTy1billion[MM] -- Oh. Location is for the array you are giving to the shader[2015-12-16. : 3:55 am] Dem0n -- idk. setUniformValue takes in 'int location' as its first parameter, and in the shader there are layout location things defined[2015-12-16. : 3:53 am] O)FaRTy1billion[MM] -- For your next assignment, do rudimentary depth of field [2015-12-16. : 3:52 am] O)FaRTy1billion[MM] -- try without it since you should have fixed glColor with the shader[2015-12-16. : 3:48 am] Dem0n -- I have a uniform vec4 Color in my shader, and I'm trying to do wire_shader.setUniformValue("Color", colorVec)[2015-12-16. : 3:47 am] Dem0n -- First parameter is const char *, and I'm passing in a string like the other one does, but it says, "cannot convert from const char [7] to int"[2015-12-16. : 3:47 am] O)FaRTy1billion[MM] -- What are you setting? You shouldn't need the color one anymore[2015-12-16. : 3:44 am] O)FaRTy1billion[MM] -- Dem0nDem0n shouted: oh i'm supposed to set it to vColor. duh right, because this shader has the color input but instead sets gl_FragColor to a constant color[2015-12-16. : 3:43 am] O)FaRTy1billion[MM] -- Hmm, gl_FragColor might be a vec4, but it might not matter[2015-12-16. : 3:42 am] O)FaRTy1billion[MM] -- gl_FragColor is the color drawn to the pixel, and vColor is the color outputted by the vertex shader[2015-12-16. : 3:42 am] Dem0n -- Changing gl_FragColor to vColor makes nothing show up when I run the program. or did I just do it wrong[2015-12-16. : 3:41 am] O)FaRTy1billion[MM] -- Your comment " // Colors and alpha value don't work. Not sure why, // maybe shaders are interfereing with it? Don't know // how to fix it." tipped me off on that [2015-12-16. : 3:40 am] O)FaRTy1billion[MM] -- in vec3 vColor; layout( location = 0 ) out vec4 FragColor; void main(){ gl_FragColor = vec4(1, .5, 1.0, 0.8); }[2015-12-16. : 3:39 am] Dem0n -- FaRTy1billionFaRTy1billion shouted: you can do vec3 Is that a type outside of a shader? Or do I have just have to pass a normal vector into setUniformValue?[2015-12-16. : 3:38 am] Dem0n -- I've done them a little bit, but I never understood them so I didn't get the desired reults [2015-12-16. : 3:37 am] O)FaRTy1billion[MM] -- have you done shaders at all, or has it so far just been "This project uses a shader."?[2015-12-16. : 3:37 am] Dem0n -- If I want my uniform to be vec3 (so that it has rbg values), do I just pass in a normal vector? Or does it have to be something special?[2015-12-16. : 3:36 am] O)FaRTy1billion[MM] -- I did (float)rand()/RAND_MAX as my value, so that it is in the range 0.0 to 1.0[2015-12-16. : 3:34 am] O)FaRTy1billion[MM] -- so any geometry drawn will be using that shader, until a different is bound[2015-12-16. : 3:33 am] O)FaRTy1billion[MM] -- No. Bind just says "I'm using this shader program now."[2015-12-16. : 3:33 am] Dem0n -- Do I have to call bind() whenever I set the uniform value? I don't really know that does.[2015-12-16. : 3:31 am] O)FaRTy1billion[MM] -- But yes. A uniform is a value that is passed from your code to the shader program, which contains all of the shaders[2015-12-16. : 3:28 am] O)FaRTy1billion[MM] -- copy one of those in to your render code that sets the random value[2015-12-16. : 3:26 am] Dem0n -- The one I showed you last night had it because I was using more complex code, but I started over with a simpler project that doesn't have all that shading shit[2015-12-16. : 3:25 am] Dem0n -- did I send you the wrong file? I don't think the one I meant to send you has them[2015-12-16. : 3:25 am] O)FaRTy1billion[MM] -- so after your phong_shader.bind(); do phong_shader.setUniformValue("randorwhatever", thing);[2015-12-16. : 3:23 am] O)FaRTy1billion[MM] -- I didn't find that function, but I found what you need. phong_shader.setUniformValue("MVP", MVP);[2015-12-16. : 3:21 am] O)FaRTy1billion[MM] -- Dem0nDem0n shouted: Does prepareShaderProgram() sound a good place to do that? is it in the code you sent me? I was trying to figure out why my glext.h wasn't working |