![](//www.dsy.it/forum/images/space.gif) |
ButterFlower |
example_shading , texture e bump mapping |
10-11-2008 11:43 |
|
![Contract Post Collapse](//www.dsy.it/forum/images/collapse.gif) |
ButterFlower |
.arcimaestro.
![](avatar.php?userid=10136&dateline=1220262094)
Registered: Oct 2007
Posts: 443 (0.07 al dì)
Location:
Corso: Comunicazione Digitale
Anno: 3°
Time Online: 9 Days, 22:21:53 [...]
Status: Offline
Edit | Report | IP: Logged |
example_shading , texture e bump mapping
ciao!
ho provato a far andare l'esercizio dell'ultima volta sul mio pc...
quello con la texture lego e il bump...
ovviamente li ho sostituiti con immagini mie e converititi in .tx e cambiato i nomi nel .rib...
insomma tutto a posto, ma quando eseguo il .rib mi dice:
example_shading.rib (46): Unable open texture "ps.tx"
example_shading.rib (46): Unable open texture "tre.tx"
voi ci avete provato?funziona?
grazie ciao!![:)](images/smilies/smile.gif)
|
10-11-2008 11:43 |
|
|
| ![](//www.dsy.it/forum/images/space.gif) |
![](//www.dsy.it/forum/images/space.gif) |
ButterFlower |
come non detto.....risolto!:D ... |
10-11-2008 11:44 |
|
![Contract Post Collapse](//www.dsy.it/forum/images/collapse.gif) |
ButterFlower |
.arcimaestro.
![](avatar.php?userid=10136&dateline=1220262094)
Registered: Oct 2007
Posts: 443 (0.07 al dì)
Location:
Corso: Comunicazione Digitale
Anno: 3°
Time Online: 9 Days, 22:21:53 [...]
Status: Offline
Edit | Report | IP: Logged |
come non detto.....risolto!![:D](images/smilies/icon_mrgreen.gif)
|
10-11-2008 11:44 |
|
|
| ![](//www.dsy.it/forum/images/space.gif) |
![](//www.dsy.it/forum/images/space.gif) |
Ste.dv |
Poiché evidentemente l'hai trascritto, potresti i ... |
10-11-2008 11:57 |
|
![Contract Post Collapse](//www.dsy.it/forum/images/collapse.gif) |
Ste.dv |
.precettore.
Registered: Apr 2008
Posts: 86 (0.01 al dì)
Location:
Corso:
Anno:
Time Online: 23:04:59 [...]
Status: Offline
Edit | Report | IP: Logged |
Poiché evidentemente l'hai trascritto, potresti incollare qui il codice relativo all'uso del bump mapping (basta lo shader)?
È l'unica cosa che non riesco a provare perché Viale non ha ancora messo l'esercizio sul sito.
Grazie.
|
10-11-2008 11:57 |
|
|
| ![](//www.dsy.it/forum/images/space.gif) |
![](//www.dsy.it/forum/images/space.gif) |
ButterFlower |
sul sito c'è!l'ho preso li!
... |
10-11-2008 12:37 |
|
![Contract Post Collapse](//www.dsy.it/forum/images/collapse.gif) |
ButterFlower |
.arcimaestro.
![](avatar.php?userid=10136&dateline=1220262094)
Registered: Oct 2007
Posts: 443 (0.07 al dì)
Location:
Corso: Comunicazione Digitale
Anno: 3°
Time Online: 9 Days, 22:21:53 [...]
Status: Offline
Edit | Report | IP: Logged |
sul sito c'è!l'ho preso li!
comunque è questo:
RIB
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]
Surface "myCartoon" "point lightPos" [12 10 10]
Color [0 1 0]
Sphere 1 -1 1 360
AttributeEnd
AttributeBegin
ConcatTransform [1 0 0 0 0 1 0 0 0 0 1 0 0.866674 1 3.93264 1]
Surface "myPhong"
Color [1 0 0]
Sphere 1 -1 1 360
AttributeEnd
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 texName" "legologo.tx" "float ss" -4 "float tt" 4 "string texDiffusive" "noise.tx"
Color [1 0 0]
Sphere 1 -1 1 360
AttributeEnd
AttributeBegin
Scale -100 -100 -100
Surface "constant"
Color [0.5 0.5 0.5]
Sphere 1 -1 1 360
AttributeEnd
WorldEnd
SHADER
surface myTexture (string texName = "", texDiffusive = ""; float ss = 1, tt = 1, Kd = 1.0)
{
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);
}
|
10-11-2008 12:37 |
|
|
| ![](//www.dsy.it/forum/images/space.gif) |
![](//www.dsy.it/forum/images/space.gif) |
ButterFlower |
comunque non penso sia completo lo shader per il b ... |
10-11-2008 12:42 |
|
![Contract Post Collapse](//www.dsy.it/forum/images/collapse.gif) |
ButterFlower |
.arcimaestro.
![](avatar.php?userid=10136&dateline=1220262094)
Registered: Oct 2007
Posts: 443 (0.07 al dì)
Location:
Corso: Comunicazione Digitale
Anno: 3°
Time Online: 9 Days, 22:21:53 [...]
Status: Offline
Edit | Report | IP: Logged |
comunque non penso sia completo lo shader per il bump che ha messo il prof perchè ad esempio manca il calcolo della normale...
|
10-11-2008 12:42 |
|
|
| ![](//www.dsy.it/forum/images/space.gif) |
![](//www.dsy.it/forum/images/space.gif) |
Ste.dv |
Infatti. Questo shader mostra solo l'applicazione ... |
10-11-2008 17:17 |
|
![Contract Post Collapse](//www.dsy.it/forum/images/collapse.gif) |
Ste.dv |
.precettore.
Registered: Apr 2008
Posts: 86 (0.01 al dì)
Location:
Corso:
Anno:
Time Online: 23:04:59 [...]
Status: Offline
Edit | Report | IP: Logged |
Infatti. Questo shader mostra solo l'applicazione delle texture.
L'ultimissimo, fatto mercoledì scorso, manca.
Grazie comunque.
|
10-11-2008 17:17 |
|
|
| ![](//www.dsy.it/forum/images/space.gif) |
![](//www.dsy.it/forum/images/space.gif) |
ButterFlower |
|
![Contract Post Collapse](//www.dsy.it/forum/images/collapse.gif) |
ButterFlower |
.arcimaestro.
![](avatar.php?userid=10136&dateline=1220262094)
Registered: Oct 2007
Posts: 443 (0.07 al dì)
Location:
Corso: Comunicazione Digitale
Anno: 3°
Time Online: 9 Days, 22:21:53 [...]
Status: Offline
Edit | Report | IP: Logged |
![;)](images/smilies/icon_wink.gif)
ps: qualcuno ha trovato in giro una guida/tutorial su pixie che non sia il wiki del sito??
|
10-11-2008 17:18 |
|
|
| ![](//www.dsy.it/forum/images/space.gif) |
![](//www.dsy.it/forum/images/space.gif) |
Supernick |
Per chi interessasse son riuscito a fare il bump m ... |
23-11-2008 14:06 |
|
![Contract Post Collapse](//www.dsy.it/forum/images/collapse.gif) |
Supernick |
.tritagranchi.
![](avatar.php?userid=10638&dateline=1238610211)
Registered: Jan 2008
Posts: 323 (0.05 al dì)
Location: Albairate (MI)
Corso: Comunicazione Digitale
Anno: 3°
Time Online: 1 Day, 17:31:17 [...]
Status: Offline
Edit | Report | IP: Logged |
Per chi interessasse son riuscito a fare il bump mapping
ecco qui il codice per lo shader:
surface myShader (string texName = "", texDiffusive = ""; float ss = 1, tt = 1, Kd = 1.0, Km = 1.0)
{
color myColor;
float myKd, amp;
vector newP;
normal Nf, tempN;
Nf = faceforward( normalize(N), I);
if (texDiffusive == "")
myKd = Kd;
else
amp = Km * float texture (texDiffusive, s, t);
newP = amp * normalize(N) + P;
tempN = calculatenormal(newP);
Nf = faceforward (normalize (tempN), I);
myKd = Kd;
if (texName == "")
myColor = Cs;
else
myColor = texture( texName , s * ss, t * tt);
Ci = myColor * myKd * diffuse(Nf);
}
Praticamente basta mettere in un float le informazione della texture di bump (in questo caso ho lasciato il nome texDiffuse) , e mettere in un vettore newP un vettore che si basa sulle info passategli dalla texture
enjoy!
Last edited by Supernick on 23-11-2008 at 14:18
|
23-11-2008 14:06 |
|
|
| ![](//www.dsy.it/forum/images/space.gif) |
![](//www.dsy.it/forum/images/space.gif) |
All times are GMT. The time now is 18:46. |
|
|
![Post New Thread](images/newthread.gif) |
|
![Post A Reply](images/reply.gif) |
|
|
| ![](//www.dsy.it/forum/images/space.gif) |
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|