yes, exacly. but for what is vec4 texCoord, even Lighting JME shader don’t use it…
@wezrule said:
[java]color *= texture2D(m_ColorMap, vec2(texCoord));[/java]
Or you can be specific and use the right swizzle: texCoord.xy
@oxplay2 said:
yes, exacly. but for what is vec4 texCoord, even Lighting JME shader don't use it...
You only need a vec4 if you need all four. A common example is a sprite shader that needs them to know where the two corners of the texture are.
thank you
can you also tell me how to make GLSL libs?
is it the same like in C? and files need to be in same folder?
@oxplay2 said:
thank you :)
can you also tell me how to make GLSL libs?
is it the same like in C? and files need to be in same folder?
It's looked up like every other asset in JME.
ok, i will try, thank you
@oxplay2 @wezrule
JME pass a vector2 as textcoord because texture coordinates are stored as 2 elements vector in the mesh.
Of course if you have you own mesh you can make texcoord whatever you want. feeding a vec2 to a vec4 will work but that’s a waste of gpu bandwidth.
also instead of doing texture2D(m_ColorMap, vec2(texCoord)); where texCoordis a vec4 you can go texture2D(m_ColorMap, texCoord.xy);
this is a powerful glsl feature any vector element can fetched like this
vec4 : myVec4.xyzw or myVec4.rgba. that does the same thing and return a vec4(x,y,z,w)
you can easily fetch a vec3 or 2 from a vec4 : myVec4.xyz returns a vec3(x,y,z).
But the most powerful thing about this is that you can go myVec4.agbr or even myVec4.aagg, and switching or duplicating the attributes.
It makes manipulating vectors very easy and swaping channels in colors for example is ubber simple.
wow, that is great, thanks for info! :o
so easy to flip data.
Nice. I like that in video 3 there are some errors that are fixed. I think that is good in instructional videos, because you get to see the author solve actual problems and not just add stuff using a script.
Really nice work, although watching 3 and 5 is painful, I saw the mistake as you made it then had to watch as you hunted for it
cool thanks Paul and Remy <3, so i should always use vec2 unless I/someone explicity creates a vector4f texture coordinate for the mesh, thanks!
@zarch yeh but you a shader pro so :P, I agree with @androlo you pay more attention to something when it doesn’t work, regardless of what it is. And i never said these were good
Gonna work on some networking video tutorials next, I will plan and prepare them a lot better than these!
Thanks again guys! you rock <33
EDIT: and i updated the wiki to include them, as per request
Lol, I’m no Shader pro
Just coder pro
Good tutorials though, nice introduction to all the concepts.
@wezrule would you take some of your time to start blocking out the tutorial page of “Rendering Buckets”? I hardly know anything about it.
Thank you for making these tutorials.
Just not very much to say about render buckets. All geometry gets sorted into render buckets. Render buckets are drawn in a particular order. Objects in a render bucket are also drawn in a particular order specific to the bucket.
What else is there?
@wezrule said:
hmmm best person for that is @nehon I think, best ask him nicely :P
He already did actually :p. My bad, I'll make that doc.
@pspeed not a lot more, but it can be explained a bit more in depth.
@androlo said:
Nice. I like that in video 3 there are some errors that are fixed. I think that is good in instructional videos, because you get to see the author solve actual problems and not just add stuff using a script.
I second this. Some of my best teachers would intentionally make mistakes to keep us on our toes. If you're not second guessing what you're being told, there's effectively much less processing going on, i.e. less efficient learning. Once you're a shader guru, you better learn how to make mistakes on purpose ;)
p.s. congrats on 100k total video views! Also, these videos don't seem to be tied into an actual series (playlist). Is that the case or is YouTube just being weird?
I did put them in a Playlist:
[jME Tutorial 2-1] Shaders in the jMonkeyEngine - YouTube
im not sure what happens, sometimes youtube never seems to like my playlists though
haha yeh and 69 subscribers, getting some lucky numbers these days