Matcaps?
13128 10 3- oldiesgoodies
- Member
- 20 posts
- Joined: Jan. 2010
- Offline
- tamte
- Member
- 8785 posts
- Joined: July 2007
- Offline
- oldiesgoodies
- Member
- 20 posts
- Joined: Jan. 2010
- Offline
- grayOlorin
- Member
- 1799 posts
- Joined: Oct. 2010
- Offline
- oldiesgoodies
- Member
- 20 posts
- Joined: Jan. 2010
- Offline
- mestela
- Member
- 1798 posts
- Joined: May 2006
- Offline
this seemed like a good way to dabble in glsl, so I took tamte's example and made it into a glsl shader. fun stuff! i didn't know you could use url's for texture paths, thats a clever trick.
enyhoo, here it is, with some help from axebeak, thanks!
// vertex shader
varying vec3 vPos, vN;
void main() {
vPos = vec3(gl_ModelViewMatrix * gl_Vertex);
vN = normalize ( gl_NormalMatrix * gl_Normal ) ;
gl_TexCoord = gl_MultiTexCoord0;
gl_Position = gl_ProjectionMatrix * vec4(vPos, 1.0);
}
and….
enyhoo, here it is, with some help from axebeak, thanks!
// vertex shader
varying vec3 vPos, vN;
void main() {
vPos = vec3(gl_ModelViewMatrix * gl_Vertex);
vN = normalize ( gl_NormalMatrix * gl_Normal ) ;
gl_TexCoord = gl_MultiTexCoord0;
gl_Position = gl_ProjectionMatrix * vec4(vPos, 1.0);
}
and….
// fragment shader
uniform sampler2D g_smpTex;
uniform int glH_MaterialPass;
uniform float gamma;
varying vec3 vPos;
varying vec3 vN;
void HOUassignOutputs(vec3 emit, vec3 amb, vec3 diff, vec3 spec, float shiny, vec3 P, vec3 N, float alpha);
void main() {
vec3 c;
vec2 uv = normalize(vN) * 0.5 + 0.5;
vec3 n = normalize(vN);
if (glH_MaterialPass == 0 || glH_MaterialPass == 1) {
c = texture2D(g_smpTex, uv).rgb; // lookup color from normal
c = pow(c, gamma); // gamma correct
HOUassignOutputs(
/* emit */ c,
/* amb */ vec3(0.0),
/* diff */ vec3(0.0),
/* spec */ vec3(0.0),
/* shin */ 0.0,
/* P */ vPos,
/* N */ vN,
/* alpha */ 1.0
);
} else {
HOUassignOutputs(
/* emit */ vec3(0.0),
/* amb */ vec3(0.0),
/* diff */ vec3(0.0),
/* spec */ vec3(0.0),
/* shin */ 0.0,
/* P */ vPos,
/* N */ vec3(0.0),
/* alpha */ 1.0
);
}
}
- grayOlorin
- Member
- 1799 posts
- Joined: Oct. 2010
- Offline
- mestela
- Member
- 1798 posts
- Joined: May 2006
- Offline
nice library of http accessable matcap images here (scroll down, copy the image links)
http://bensimonds.com/2010/07/30/matcap-generator/#more-627 [bensimonds.com]
and some locally installable ones here:
http://www.bzfusion.net/skymaps/Misc/zbrush-mats.rar [bzfusion.net]
http://bensimonds.com/2010/07/30/matcap-generator/#more-627 [bensimonds.com]
and some locally installable ones here:
http://www.bzfusion.net/skymaps/Misc/zbrush-mats.rar [bzfusion.net]
- vbk!!!
- Member
- 383 posts
- Joined:
- Offline
hi
I just download the otl of mestela
Unfortunately it give me an error because of the “pow” function.
It seems my houdini doesn't recognize it.
here is the error message :
Fragment shader compile:
Fragment shader failed to compile with the following errors:
WARNING: 0:12: warning(#402) Implicit truncation of vector from size: 3 to size: 2
ERROR: 0:18: error(#202) No matching overloaded function found: pow
WARNING: 0:18: warning(#402) Implicit truncation of vector from size: 1 to size: 3
ERROR: error(#273) 1 compilation errors. No code generated
Once I erase the line with the “pow” function, everything works fine.
Can someone explain that to me ?
What did I forget ?
Thanks for your help.
I just download the otl of mestela
Unfortunately it give me an error because of the “pow” function.
It seems my houdini doesn't recognize it.
here is the error message :
Fragment shader compile:
Fragment shader failed to compile with the following errors:
WARNING: 0:12: warning(#402) Implicit truncation of vector from size: 3 to size: 2
ERROR: 0:18: error(#202) No matching overloaded function found: pow
WARNING: 0:18: warning(#402) Implicit truncation of vector from size: 1 to size: 3
ERROR: error(#273) 1 compilation errors. No code generated
Once I erase the line with the “pow” function, everything works fine.
Can someone explain that to me ?
What did I forget ?
Thanks for your help.
- pedro3145
- Member
- 41 posts
- Joined: Feb. 2014
- Offline
vbk!!!
hi
I just download the otl of mestela
Unfortunately it give me an error because of the “pow” function.
It seems my houdini doesn't recognize it.
here is the error message :
Fragment shader compile:
Fragment shader failed to compile with the following errors:
WARNING: 0:12: warning(#402) Implicit truncation of vector from size: 3 to size: 2
ERROR: 0:18: error(#202) No matching overloaded function found: pow
WARNING: 0:18: warning(#402) Implicit truncation of vector from size: 1 to size: 3
ERROR: error(#273) 1 compilation errors. No code generated
Once I erase the line with the “pow” function, everything works fine.
Can someone explain that to me ?
What did I forget ?
Thanks for your help.
What version are you using? This doesn't even work for me it's just transparent. I tried to implement it again using Houdini 13 but not luck. I think that maybe the code its just compatible with the version they were using at that time.
- edward
- Member
- 7871 posts
- Joined: July 2005
- Offline
-
- Quick Links