Wednesday, January 28, 2009

My Wife


My wife gave me a suggestion, and i try that it's better than the previous effect.
What do you think about it?

--

Mia moglie mi ha dato un suggerimento su come implementare la scia, ed in effetti mi sembra decisamente meglio ora rispetto a prima.

Che ne dite?



Tuesday, January 27, 2009

Engine Trails: what do you think about it?


I'm working now to the starships engine trails, an effect that i love (on Homeworld i've seen the best trails of ever!), and i've finished the first prototype.
But.. i'm not sure about it.
So before continue i want to show you the effect and ask you if you like it, if you change something, and any comment that you want to make.
It's difficult for a developer to be objective on his work, so i need some critics ;)

Tell me!

---

Sto lavorando alle scie che vengono lasciate dai motori delle astronavi, un effetto che personalmente adoro (su Homeworld ho visto le migliori in assoluto), ed ho appena terminato un prototipo.
Pero'... non son sicuro del risultato.
Cosi', prima di continuare, avrei piacere se mi deste un vostro parere, se vi piace, se cambiereste qualcosa, e qualsiasi cosa vi passi per la testa.

E' difficile per me essere obiettivo riguardo al mio lavoro, cosi' ho bisogno di un po' di critiche :)


Friday, January 23, 2009

Time to try

A lot of people asked me to try a demo of my work.
So... why not?

Download from here

(if it doesn't works, try to copy the address: http://pdg.altervista.org/Tau_Ceti.rar and paste into another browser window-tab" option)

But... there's some problem that i was not able to solve: when i compile, it works on my pc, but when i try to run on others, i obtain an error like "d3dx9_37.dll not found".
I've discovered that you need to install the latest version of direct, i hope you need only the redistributable version of directx, but pheraps you need the sdk archive.
If you've time and enough speed on your line, download the archive here.

To use the demo:

  1. extract the archive where you want
  2. launch tau ceti.exe
  3. if you obtain errors like "dll missing", update your directx using the link above.

The demo has a lot of key to press

  • move the mouse while keeping the right mouse pressed: rotate the camera
  • WASD move the ship. W and S accelerate and decelerate (inertial) , A and D rotate around the Y axis
  • PLOK rotate around X and Z axis
  • 8246 on numpad: move the ship (no inertial)
  • 5 on numpad: stop the ship (if it's moving by inertia)
  • F1 to F10 select the time compression.
  • 1 to 10 select the speed compression (works only with the numpad moving)
  • F fullscreen mode (ESC to back to window mode)
  • V inside-outside view. In outside view, key + and - of numpad zooms out and in.
  • BN adjust the display size

It's obviously only a tech demo, there's no game and for now only 2 or 3 planets.

---

Me l'avete chiesto in tanti, e pur essendo il tutto ancora un cantiere e non certo un gioco, ho deciso di provare a rilasciarvi l'eseguibile, cosi' che possiate pasticciarci.
E' ovviamente un semplice tech demo, non c'e' gioco, e tra l'altro alcune mesh che avete visto in passato sono momentaneamente disabilitate causa lavori in corso.
Non aspettatevi chissa' che, ma se siete curiosi eccolo qui:

Scarica demo Tau ceti

(se non vi funziona provate a copiare l'indirizzo http://pdg.altervista.org/Tau_Ceti.rar e ad incollarlo in una nuova finestra o tab del browser)

A quanto pare per girare richiede l'ultima versione delle directx.. ho provato invano a litigare col compilatore affinche' possa girare su un qualsiasi sistema che abbia le directx 9.0c, ma a quanto pare invece vuole proprio l'ultima versione, altrimenti vi da un errore tipo "manca la dll d3dx9_37.dll".
Io spero che installando l'ultima versione vi funzioni, altrimenti, se avete tempo e banda, installatevi la sdk di microsoft che trovate qui

L'installazione e' semplice:

  1. Scaricate la demo
  2. Decomprimete l'archivio in una directory qualsiasi.
  3. Lanciate "Tau Ceti.exe". Se vi da l'errore "manca la dll" di cui sopra, scaricatevi l'sdk dal link che vi ho dato.
Se il gioco parte (vi appare la terra in una finestra) ci sono un po' di tasti che potete usare

  • Tasto destro del mouse, tenuto premuto, e muovendo il mouse: sposta la telecamera
  • WASD per il movimento: WS per accelerare decelerare (inerziale), AD ruota attorno l'asse Y
  • PLOK ruota attorno gli assi X e Z
  • 8246 del tastierino numerico sposta l'astronave (movimento non inerziale)
  • 5 del tastierino numerico annulla l'eventuale inerzia (se vi state muovendo, si ferma di colpo)
  • da F1 a F10: compressione del tempo
  • da 1 a 0: selezione della velocita' di spostamento quando si usa il tastierino numerico per muoversi
  • F passa a tutto schermo (ESC per tornare a finestra)
  • V seleziona le visuali interna o esterna dell'astonave. Se siete fuori dall'astronave con i tasti + e - del tastierino numerico ingrandite o rimpicciolite l'astronave.
  • BN regola la dimensione dello schermo.
Insisto: e' tutto un cantiere, e' pieno di schifezze qua e la, e non sarebbe dignitoso nemmeno come screen saver, ma ovviamente ho piacere se mi date il vostro feedback una volta che siete riusciti a farlo partire
(E se mi spiegate come riuscire ad eliminare la dipendenza da quella ddl mi fate un piacere!)


Tuesday, January 20, 2009

Bloom inside the Game

Ok, now is time to implement the bloom effect inside Tau Ceti engine.
There's no more to say: implementation was easy, and you can see the result on next video.
There's some imperfection on bloom dislocation, it seems that it is a little shifted on right, anyway do you like it?

The bloom is exaggerated intentionally due to the low quality of youtube so you can notice it.

--

Bene, e' tempo di implementare quanto visto nei giorni scorsi all'interno del gioco vero e proprio.
C'e' poco da dire: il lavoro e' stato per fortuna semplice e ne potete vedere il risultato nel video che segue. Ci sono ancora alcune imperfezioni, gli aloni sono un po' spostati a destra rispetto alla posizione che dovrebbero avere, ma mi sembra che il risultato sia comunque soddisfacente. Ovviamente cerchero' di limare questi problemi.
Ad ogni modo che ve ne pare?

Ah il video mostra una luminescenza un po' esagerata, questo per permettere che si possa notare anche con la bassa qualita' di youtube.

Friday, January 16, 2009

Bloom: finished!


Ladies and Gentleman...

The bloom shaders!

Was obtained with 9 different post-process effects!

I'm very happy :)

--

Signore e signori...

Ecco l'effetto bloom!

Ottenuto con 9 differenti passaggi di post-processing!

Sono molto contento :)

Wednesday, January 14, 2009

Bloom: first steps

I've made some other important steps into the bloom implementation, using pixel shaders. I've discovered how to make a "pipeline" of pixel shaders, a necessary tool to make complex effect like Bloom or HDR.
We have seen, last time, that to make a bloom effect it's necessary to execute more than one shader in sequence.
The effect is obtained:

  1. scaling down the original picture by 16 times
  2. isolating only bright parts of the reducted image
  3. blurring orrizontally and vertically the bright parts
  4. scaling up the result
  5. merge the scaled result with the original frame.

The problem was: how can i use the shader output like input for the next shader step?
I've found a trick:

  • I draw the entire scene and i render it into a texture. I'll call it TexA.
  • I draw a rectangle that fills all the screen, and i apply the texture TexA on it. Then i render it using the first shader. I'll call it ShaderA. The result is not drawed into back buffer (the screen), but into another texture. I'll call it TexB.
  • I draw another rectangle, idendical to the previous, and i apply the teture TexB on it. Then i render it using the secon shader. I'll called it ShaderB. Now if there's no more shaders on the pipeline i'll put it into the back buffer, otherwise i'll iterate the procedure using other textures (TexC, TexD and so on...) one for each shader. To optimize the memory usage i can use only two texture and swap it every cycle.

It works! In the next video you can see a result of applying two pixel shaders to the same scene: a blur effect, then a simple light effect. It's not the final result that i want to obtain but it's essential to make all the trip.

---

Ho fatto alcuni importanti passi nella realizzazione dell'effetto bloom usando i pixel shader. Risultato che non serve esclusivamente ad ottenere l'effetto bloom, ma anche per la realizzazione di molti effetti complessi come ad esempio l'HDR, il motion blur e tanto altro.
Abbiamo visto la volta precedente che per ottenere l'effetto "bloom" e' necessario eseguire piu' di uno shader in sequenza.
Nello specifico l'effetto e' ottenuto:

  1. rimpicciolendo di 16 volte l'immagine originale
  2. isolando le parti luminose dall'immagine rimpicciolita
  3. sfuocando orrizontalmente e verticalmente le parti luminose
  4. ingrandendo di 16 volte l'immagine sfuocata
  5. fondendo assieme l'immagine appena ingrandita all'immagine originale.

Il problema che mi bloccava fino ad oggi era: come puo' l'output di uno shader essere usato come input per lo shader seguente?
E mi e' venuta un'idea:

  • Disegno la scena intera all'interno di una singola Texture anziche' sullo schermo. Chiamo per semplicita' questa texture TexA.
  • Disegno un rettangolo che riempia l'intero schermo e vi applico la texture TexA. Dopodiche' lo elaboro con il primo shader, che chiameremo ShaderA. Il risultato non lo mostro a video ma lo metto in una seconda Texture, che chiamero' TexB.
  • Disegno un altro rettangolo, identico al precedente, solo che a questo applico la texture TexB. Dopodiche' lo elaboro con il secondo shader, che chiameremo ShaderB. A questo punto se vi sono altri shaders da elaborare continuo con la logica precedente utilizzando altre textures (TexC, ecc..), altrimenti mostro il risultato a video, risultato che sara' quindi la somma degli effetti degli shaders applicati uno alla volta all'immagine iniziale

Funziona! Nel video che segue potete vedere ad esempio il risultato di applicare due shader alla medesima scena: un effetto di sfuocamento, e poi un effetto "abbagliamento". Non e' proprio il bloom, ma e' un banco di prova necessario per ottenere il risultato al quale voglio arrivare.

Friday, January 9, 2009

Post Processing

I've tried to learn how to obtain a bloom effect like that you've seen on previous post, and i've understand that the procedure is:

- render the scene not into the back buffer but into a texture.
- for each pixel of the texture: if the bright is major than a value, increase it. else leave it black. Then blur the result, and add to the original source.

Anyway all is made using pixel shaders, so i've started to learn how to apply a pixel shader not only to a mesh but to the whole scene.

In this video you can see my first experiment, a simple "underwater" shader (i've used not tau ceti but a more simple project to do the job quick and dirty). It's just a first step to make a more complex post processing procedure.

--

Ho cercato di capire come ottenere l'effetto bloom che vi ho illustrato nel post precedente.
Studiando ho capito che la procedura da seguire e' la seguente:

- Renderizzare la scena non a video ma in una texture.
- Tramite pixel shaders, prendere la texture e per qualsiasi pixel: controllare la luminosita', se e' maggiore di una certa soglia aumentarla ancor di piu', altrimenti lasciar nero, eseguire un blur gaussiano e aggiungere il risultato all'immagine sorgente.

Quindi bisogna modificare la procedura di rendering e creare dei pixel shaders per eseguire il post processing.

Vi mostro un esperimento.. e' un effetto "subaqueo" che ho creato giocando un po' con le coordinate uv della texure.. non c'entra con tau ceti, ma e' la base per poi costruire effetti complessi.

Wednesday, January 7, 2009

I need your help


I'm tired about the "1990 style" of my graphics, i'd like to implemente a more realistic light model.
And i think that the solution could come from the bloom model. I've played a lot with Mass Effect and i love it's bloom effect.
But... i need some tutorial for starting, so have you any link/material to read? I need some tutorial that uses the directx framework.
For now a bloom effect applied to the cobra mk3 created with an hdr demo.

Thank you

---

Sono stanco dell'aspetto "anni 90" che ha la grafica del gioco, vorrei fare un passo in piu' ed implementare un modello di illuminazione piu' realistico. E credo che questo passo possa essere l'implementazione del modello "bloom". Se avete giocato un po' a Mass Effect (gioco che adoro), avete capito a cosa mi riferisco.
L'effetto che mi piacerebbe ottenere e' quello ma.. mi serve qualche tutorial o articolo da studiare. Che spieghi come implementare il tutto sotto directx ovviamente.
Per ora vi lascio con un effetto bloom applicato alla mesh del cobra mk3, creato con un piccolo demo HDR che ho trovato su internet

Monday, January 5, 2009

Atmosphere


I'm starting to make some atmosphere effect using the blending equation.
It's still raw, but it works.
To make it more realistic i'll try to use a noise texture on atmosphere and see it how it works.. the best should be to apply the noise to the alpha value, not to the color, but it's not very simple, i need to create a shader ad hoc.

If you're some ideas...

---

Ho cominciato ad implementare qualche effetto atmosferico utilizzando l'equazione di blending.
E' ancora grezzo ma funziona. Per rendere l'atmosfera piu' realistica pensavo di utilizzare una texture casuale, sarebbe bello riuscirla ad applicare al valore alpha anziche' ai colori, e probabilmente con gli shaders si riesce pure.

Se avete idee..