Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Didattica > Corsi G - M > Grafica e immagini digitali > example_shading , texture e bump mapping
  Last Thread   Next Thread
Author
Thread    Post New Thread    Post A Reply
ButterFlower
.arcimaestro.

User info:
Registered: Oct 2007
Posts: 443 (0.07 al dì)
Location:
Corso: Comunicazione Digitale
Anno:
Time Online: 9 Days, 22:21:53 [...]
Status: Offline

Post actions:

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!:)

10-11-2008 11:43
Click Here to See the Profile for ButterFlower Click here to Send ButterFlower a Private Message Visit ButterFlower's homepage! Find more posts by ButterFlower Add ButterFlower to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
ButterFlower
.arcimaestro.

User info:
Registered: Oct 2007
Posts: 443 (0.07 al dì)
Location:
Corso: Comunicazione Digitale
Anno:
Time Online: 9 Days, 22:21:53 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

come non detto.....risolto!:D

10-11-2008 11:44
Click Here to See the Profile for ButterFlower Click here to Send ButterFlower a Private Message Visit ButterFlower's homepage! Find more posts by ButterFlower Add ButterFlower to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Ste.dv
.precettore.

User info:
Registered: Apr 2008
Posts: 86 (0.01 al dì)
Location:
Corso:
Anno:
Time Online: 23:04:59 [...]
Status: Offline

Post actions:

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
Click Here to See the Profile for Ste.dv Click here to Send Ste.dv a Private Message Find more posts by Ste.dv Add Ste.dv to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
ButterFlower
.arcimaestro.

User info:
Registered: Oct 2007
Posts: 443 (0.07 al dì)
Location:
Corso: Comunicazione Digitale
Anno:
Time Online: 9 Days, 22:21:53 [...]
Status: Offline

Post actions:

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
Click Here to See the Profile for ButterFlower Click here to Send ButterFlower a Private Message Visit ButterFlower's homepage! Find more posts by ButterFlower Add ButterFlower to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
ButterFlower
.arcimaestro.

User info:
Registered: Oct 2007
Posts: 443 (0.07 al dì)
Location:
Corso: Comunicazione Digitale
Anno:
Time Online: 9 Days, 22:21:53 [...]
Status: Offline

Post actions:

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
Click Here to See the Profile for ButterFlower Click here to Send ButterFlower a Private Message Visit ButterFlower's homepage! Find more posts by ButterFlower Add ButterFlower to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Ste.dv
.precettore.

User info:
Registered: Apr 2008
Posts: 86 (0.01 al dì)
Location:
Corso:
Anno:
Time Online: 23:04:59 [...]
Status: Offline

Post actions:

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
Click Here to See the Profile for Ste.dv Click here to Send Ste.dv a Private Message Find more posts by Ste.dv Add Ste.dv to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
ButterFlower
.arcimaestro.

User info:
Registered: Oct 2007
Posts: 443 (0.07 al dì)
Location:
Corso: Comunicazione Digitale
Anno:
Time Online: 9 Days, 22:21:53 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

;)

ps: qualcuno ha trovato in giro una guida/tutorial su pixie che non sia il wiki del sito??

10-11-2008 17:18
Click Here to See the Profile for ButterFlower Click here to Send ButterFlower a Private Message Visit ButterFlower's homepage! Find more posts by ButterFlower Add ButterFlower to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Supernick
.tritagranchi.

User info:
Registered: Jan 2008
Posts: 323 (0.05 al dì)
Location: Albairate (MI)
Corso: Comunicazione Digitale
Anno:
Time Online: 1 Day, 17:31:17 [...]
Status: Offline

Post actions:

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
Click Here to See the Profile for Supernick Click here to Send Supernick a Private Message Find more posts by Supernick Add Supernick to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 09:22.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

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
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.048 seconds (63.07% PHP - 36.93% MySQL) con 25 query.