Texture
Posted by alealex on 01-12-2008 09:18
Scusate ragazzi ma stò impazzendo con le texture...
Allora: io ho qst semplicissimo file Rib (una sfera)
Option "searchpath" "shader" [".:./shaders:&"]
Option "searchpath" "texture" [".:./textures:&"]
Format 640 480 1
Display "teapots.tif" "tiff" "rgba"
Projection "perspective" "fov" [24]
Transform [0.947768 -0.137508 -0.287796 0 -1.38778e-017 0.902297 -0.431115 0 -0.318959 -0.408597 -0.855169 0 -2.04281e-014 -2.24265e-014 17.9935 1]
WorldBegin
LightSource "ambientlight" 0 "intensity" [0.1] "lightcolor" [1 1 1]
LightSource "pointlight" 1 "intensity" [650]"lightcolor" [1 1 1]"from" [12 10 10]
LightSource "pointlight" 2 "intensity" [200]"lightcolor" [1 1 1]"from" [-12 5 15]
AttributeBegin
ConcatTransform [1 0 0 0 0 1 0 0 0 0 1 0 2 1 0 1]
Rotate 90 1 0 0
Surface "myTexture" "string texDiffusive" "noise3.tx" "string texName" "legologo.tx" "float ss" -4 "float tt" 4
Color [1 0 0]
Sphere 1 -1 1 360
AttributeEnd
AttributeBegin
Scale -100 -100 -100
Surface "constant"
Color [0.3 0.3 0.3]
Sphere 1 -1 1 360
AttributeEnd
WorldEnd
il mio shader di nome "myTexture" invece è qst (mette come texture un'immagine)...
surface myTexture (string texName = "", texDiffusive = ""; float ss = 1, tt = 1, Kd = 0.5)
{
color myColor;
float myKd;
normal Nf;
Nf = faceforward( normalize(N), I);
if (texDiffusive == "")
myKd = Kd;
else
myKd = float texture (texDiffusive, s * ss, t * tt);
if (texName == "")
myColor = Cs;
else
myColor = texture( texName , s * ss, t * tt);
Ci = myColor * myKd * diffuse(Nf);
}
Il problema è che so lo renderizzo, si vede l'immagine del lego ma è nera al posto di essere rossa. Non riesco a capire il perchè...
Per trasformare l'immagine da TIFF a TX ho usato qst comando:
texmake legologo.tiff -smode periodic -tmode periodic -filter gaussian legologo.tx
Qualcuna mi può aiutare???...GRAZIE!!!!
Powered by: vbHome (lite) v3.8 and vBulletin v2.3.1
Copyright © 2000 - 2002 Jelsoft Enterprises Limited