Welcome to Fractal Forums

Fractal Software => Fragmentarium => Topic started by: cyberxaos on November 18, 2012, 09:25:48 PM




Title: Failed to load texture
Post by: cyberxaos on November 18, 2012, 09:25:48 PM
Can someone please help me understand why Fragmentarium is not running the Textures.frag tutorial example?  I am getting the following in the log:

Parse: /Applications/Fragmentarium/Examples/Tutorials/04 - Textures.frag
Including file: /Applications/Fragmentarium/Examples/Include/2D.frag
Added texture: texture -> /Applications/Fragmentarium/Examples/Include/texture2.jpg
Setting texture to: /Applications/Fragmentarium/Examples/Include/texture2.jpg
Failed to load texture: /Applications/Fragmentarium/Examples/Include/texture2.jpg
Compiled script in 21 ms.
Found 'default' index. Executing...

...and then I get a black render area, of course.  Any *.frag files that use textures fail to load them, in this manner, even though the texture files are present at the specified path.

I understand the Textures.frag src is based on http://www.iquilezles.org/apps/shadertoy/?p=tunnel which runs just fine on my system. 


Title: Re: Failed to load texture
Post by: Syntopia on November 18, 2012, 11:28:25 PM
What happens if you choose another image file by using the filechooser (the [...] button)  for 'texture' in the 'MySystem' tab?


Title: Re: Failed to load texture
Post by: M Benesi on November 19, 2012, 12:08:28 AM
I had to reload textures THEN do a rebuild.  The example didn't work way to great for me- I ended up writing my own script based off of something else you (Mikael) did to put the images onto a fractal....  and used rotations to spin them around.

Code:
//PARTIAL CODE!!! 


#group Rotations
//  Spokes number
uniform float Spokes; slider[-4,3,20]

uniform vec3 RotVector1; slider[(0,0,0),(1,1,1),(1,1,1)]
uniform float RotAngle1; slider[0.00,0,360]

mat3 rot1= rotationMatrix3(normalize(RotVector1), RotAngle1);

uniform vec3 RotVector2; slider[(0,0,0),(1,1,1),(1,1,1)]
uniform float RotAngle2; slider[0.00,0,360]

mat3 rot2= rotationMatrix3(normalize(RotVector2), RotAngle2);

uniform vec3 RotVector3; slider[(0,0,0),(1,1,1),(1,1,1)]
uniform float RotAngle3; slider[0.00,0,360]

uniform float time;
uniform float TimeStep; slider[-1.00,1,2.00]

mat3 rot3= rotationMatrix3(normalize(RotVector3), RotAngle3+time*TimeStep*.1);
//mat3 rot3;
uniform vec3 RotVector4; slider[(0,0,0),(1,1,1),(1,1,1)]
uniform float RotAngle4; slider[0.00,0,360]

mat3 rot4= rotationMatrix3(normalize(RotVector4), RotAngle4);

uniform sampler2D tex; file[quart.jpg]
uniform float TextureIter; slider[.1,5,100]

vec3 cycle(vec3 c, float s) {
return vec3(0.5)+0.5*vec3(cos(s*Cycles+c.x),cos(s*Cycles+c.y),cos(s*Cycles+c.z));
//return vec3  (texture2D(tex, c.yz)*orbitTrap.x*s*Cycles
  //  + texture2D(tex,c.xz)*orbitTrap.y*s*Cycles
   // + texture2D(tex, c.xy)*orbitTrap.z*s*Cycles);
}

vec3 color(vec3 p) {
orbitTrap = vec4(1.0);
vec3 position=p;
inside(p);

orbitTrap.w = sqrt(orbitTrap.w);
vec3 orbitColor;
if (CycleColors) { //  DOES NOT CYCLE!!!  USED AS A BOOLEAN SWITCH
//orbitColor = cycle(X.xyz,orbitTrap.x)*X.w*orbitTrap.x +
p=(p)*rot3*(rot4)*(TextureIter*length(orbitTrap));    // * abs(orbitTrap)
orbitColor = texture2D(tex, p.yz)*(X.w+AOStrength*.25)
    + texture2D(tex, p.xz)*(Y.w+AOStrength*.25)
    + texture2D(tex, p.xy)*(Z.w+AOStrength*.25);
} else {

p=(p+position)*rot3*(rot4)*(TextureIter*length(orbitTrap));    // * abs(orbitTrap)
orbitColor = texture2D(tex, p.yz)*(X.w+AOStrength*.25)
    + texture2D(tex, p.xz)*(Y.w+AOStrength*.25)
    + texture2D(tex, p.xy)*(Z.w+AOStrength*.25);
}




return orbitColor;

}




Title: Re: Failed to load texture
Post by: cyberxaos on November 19, 2012, 02:35:18 PM
What happens if you choose another image file by using the filechooser (the [...] button)  for 'texture' in the 'MySystem' tab?

Nothing, even if I rebuild.  Same error message with the new filename.


Title: Re: Failed to load texture
Post by: visual.bermarte on November 19, 2012, 03:32:40 PM
@cyberXaos: Try writing directly the absolute path


Title: Re: Failed to load texture
Post by: cyberxaos on November 19, 2012, 04:47:42 PM
@cyberXaos: Try writing directly the absolute path

It doesn't make any difference.  Same error message.


Title: Re: Failed to load texture
Post by: cyberxaos on December 05, 2012, 12:05:05 AM
All the texture examples I tried were attempting to load jpgs.  It turns out that png and hdr load fine, but jpg, for some reason, will not.