12-05-2015, 03:35 AM
Ok.. After few hickups..
Result =
AUV: Test ok
No errors, but also.. no texture. Also... did figure out that part of my issue was that I have more than one install of Wings, since the mlab one, as well as the other one, insists on installing "new" versions into unique folders every time, instead of something sensible (and thus predictable). Was trying to edit the wrong copies... Sigh... lol
Still, editing the right ones.. still didn't get me any place.
Actually. That might be easy to fix. Modern copies of windows don't like people playing with the stuff in the program folders anyway. So, seems to me that there should be a plugin folder in "Documents" for each user as well, to be consistent with other applications. And, as long as it "shared" the name of this folder, editing things in it should effect "all" copies of Wings, regardless of version.
Anyway. With the above changes it seems to compile, but.. still not do anything. Might it be setting the "alpha" to full transparency, since its only using the RGB values? Or does it default to fully visible, unless you tell it otherwise? Only thing I can think of at this point.
Code:
{name, "Test"}. % The name in the shader selector
{vertex_shader, "standard.vs"}. % Vertex shader used
{fragment_shader, "test_shader.fs"}. % Fragment shader used
{auv, auv_texsz}. % vec2 width and height
{uniform, {slider,0.0,360.0}, "angle", 0.0, "Angle"}.
Code:
#define pi 3.14159265359;
uniform float angle;
uniform vec2 auv_texsz;
vec3 roty(vec3 p,float a){return p*mat3(cos(a),0,-sin(a),0,1,0,sin(a),0,cos(a));}
float map(in vec3 p) {
float res=0.;vec3 c = p;
for (int i = 0; i < 10; i++) {
p =0.9*abs(p)/dot(p,p) -.7;
p.yz= vec2(p.y*p.y-p.z*p.z,2.*p.y*p.z);
res += exp(-20. * abs(dot(p,c)));}
return res/2.0;}
vec3 raymarch(vec3 ro, vec3 rd){
float t = 4.0;
vec3 col=vec3(0.);float c=0.;
for( int i=0; i<64; i++ ){
t+=0.02*exp(-2.0*c);
c = map(ro+t*rd);
col += vec3(c/2.0,c*c*c,c)/10.0;}
return col;}
void main(){
vec2 p = (gl_FragCoord.xy-auv_texsz.xy/2.0)/(auv_texsz.y);
//vec3 ro = roty(vec3(3.),time*0.3);
float a = angle/360.0 * 2.0*pi;
vec3 ro = roty(vec3(3.),a);
vec3 uu = normalize( cross(ro,vec3(0.0,1.0,0.0) ) );
vec3 vv = normalize( cross(uu,ro));
vec3 rd = normalize( p.x*uu + p.y*vv -ro*0.3 );
gl_FragColor.rgb = 0.5*log(1.0+raymarch(ro,rd));}
Result =
AUV: Test ok
No errors, but also.. no texture. Also... did figure out that part of my issue was that I have more than one install of Wings, since the mlab one, as well as the other one, insists on installing "new" versions into unique folders every time, instead of something sensible (and thus predictable). Was trying to edit the wrong copies... Sigh... lol
Still, editing the right ones.. still didn't get me any place.
Actually. That might be easy to fix. Modern copies of windows don't like people playing with the stuff in the program folders anyway. So, seems to me that there should be a plugin folder in "Documents" for each user as well, to be consistent with other applications. And, as long as it "shared" the name of this folder, editing things in it should effect "all" copies of Wings, regardless of version.
Anyway. With the above changes it seems to compile, but.. still not do anything. Might it be setting the "alpha" to full transparency, since its only using the RGB values? Or does it default to fully visible, unless you tell it otherwise? Only thing I can think of at this point.