Page 38 of 52

Re: Show and Tell (new ships/ ships in progress)

Posted: Wed Jan 18, 2012 2:51 pm
by MiMoriarty
Go for it. I probably don't like them much, because I couldn't figure them out.
Then, we are in the same, er...... spaceship :lol:

Anyway, I have to learn it before 22 Dec or forget it until the end of the world, which as a matter of fact would be that precise date. :shock:

Re: Show and Tell (new ships/ ships in progress)

Posted: Wed Jan 18, 2012 5:30 pm
by mandoman
MiMoriarty wrote:
Then, we are in the same, er...... spaceship :lol:

Anyway, I have to learn it before 22 Dec or forget it until the end of the world, which as a matter of fact would be that precise date. :shock:
*************ROTFLMAO********** :lol:

Re: Show and Tell (new ships/ ships in progress)

Posted: Thu Jan 19, 2012 2:48 am
by CommonSenseOTB
MiMoriarty wrote:
Go Anyway, I have to learn it before 22 Dec or forget it until the end of the world, which as a matter of fact would be that precise date. :shock:
It's the end of the world as we know it, and I feel fine. :lol:

http://youtu.be/AzqiPvGrkTo

Re: Show and Tell (new ships/ ships in progress)

Posted: Thu Jan 19, 2012 3:17 am
by mandoman
CommonSenseOTB wrote:
It's the end of the world as we know it, and I feel fine. :lol:
After that, it should be the end of the world as we know it. Those guys all need a cat-scan. :mrgreen:

Re: Show and Tell (new ships/ ships in progress)

Posted: Thu Jan 19, 2012 11:05 am
by Smivs
SandJ wrote:

(Funnily enough, I was considering seeing if I could put together a Foord Capri as a spaceship earlier this week.)
Smivs likes Capri's :D

Image

She turns 30 in April, and has been part of my life for the last 27 years.

Re: Show and Tell (new ships/ ships in progress)

Posted: Thu Jan 19, 2012 5:38 pm
by RyanHoots
Killer Wolf wrote:
"Shaders are over-rated."

matter of opinion. my ships like sht w/out them.
I think your ships look amazing even without shaders. Of course, because my machine can't run them, I have no point of comparison.

Re: Show and Tell (new ships/ ships in progress)

Posted: Thu Jan 19, 2012 5:52 pm
by DaddyHoggy
Smivs wrote:
SandJ wrote:

(Funnily enough, I was considering seeing if I could put together a Foord Capri as a spaceship earlier this week.)
Smivs likes Capri's :D

Image

She turns 30 in April, and has been part of my life for the last 27 years.
My brother in law is currently restoring an early Mk1 - beige interior, vinyl roof, sort of odd not quite metallic brown exterior - lots of chrome - dynamo instead of an alternator...

Re: Show and Tell (new ships/ ships in progress)

Posted: Thu Jan 19, 2012 6:13 pm
by Smivs
The Mk 1 was a real beauty. I had a 2L GT-XLR for four years before getting the Black Beasty.

Before that I had an Austin Maxi !

Re: Show and Tell (new ships/ ships in progress)

Posted: Thu Jan 19, 2012 10:17 pm
by CaptSolo
MiMoriarty wrote:
Go for it. I probably don't like them much, because I couldn't figure them out.
Then, we are in the same, er...... spaceship :lol:

Anyway, I have to learn it before 22 Dec or forget it until the end of the world, which as a matter of fact would be that precise date. :shock:
The important bit about shaders are:
1) Declaring the textures in the order wanted by the fragment shader
2) Creating the effects map with the correct RGB values

Study Griff's rocket shader example and his other OXP textures and you'll get the hang of it.

Re: Show and Tell (new ships/ ships in progress)

Posted: Thu Jan 19, 2012 10:20 pm
by mandoman
CaptSolo wrote:
The important bit about shaders are:
1) Declaring the textures in the order wanted by the fragment shader
2) Creating the effects map with the correct RGB values

Study Griff's rocket shader example and his other OXP textures and you'll get the hang of it.
Okay...........what? :wink:

Re: Show and Tell (new ships/ ships in progress)

Posted: Thu Jan 19, 2012 10:24 pm
by mandoman
See Mandotech Ind. Topic.

Re: Show and Tell (new ships/ ships in progress)

Posted: Fri Jan 20, 2012 8:35 am
by MiMoriarty
CaptSolo wrote:
The important bit about shaders are:
1) Declaring the textures in the order wanted by the fragment shader
2) Creating the effects map with the correct RGB values

Study Griff's rocket shader example and his other OXP textures and you'll get the hang of it.


Okay...........what?
:lol:

I've had a hard time with Griff examples and still i can't figure how to make them work. I have also tried to use a griff's Python shipdata.plist with my own models faking the textures and it still didn't work. I'm bewildered.

Maybe it has something to do with the 3D model itself. Should it be normal mapped for the shaders to work?... I don't understand the fragment vertex code because I'm not programer and this's my real problem.

Re: Show and Tell (new ships/ ships in progress)

Posted: Fri Jan 20, 2012 8:50 am
by Griff
The Rocket shader example is really out of date now, the main reason it won't work is that doesn't automatically take care of assigning your textures uniform names in the shader, you need to specify them yourself in the shipdata.plist, eg:

Code: Select all

uniforms =
	{
	uColorMap = { type = texture; value = 0; };
	uNormalMap = { type = texture; value = 1; };
	uEffectsMap = { type = texture; value = 2; };
	uDecalMap = { type = texture; value = 3; };	
	}; 	
When the rocket shader example was written, oolite would automatically refer to textures as Tex0; Tex1; Tex2 etc and you didn't need to write anything out yourself
I can try and get the rocket shader example updated and working (although as seen in the post that DaddyHoggy linked to one page back) it uses 'Macros' to calculate lighting and Ahruman stongly advises us that we shouldn't do things this way anymore - all more recent shaders (eg the ones that support normal mapping) now calculate lighting using a 'Function'.
Also, nearly all the cool shader efects are available using Oolite's Materials ( http://wiki.alioth.net/index.php/Materials_in_Oolite) - no need for shaders, just a few lines in your shipdata.plist telling Oolite what textures to use for specularity, normal and glow maps etc

MiMoriarty, mandoman etc - if you're struggling with shaders and Materials won't do what you need just post a query in the 'Shaders Outpost' thread and somebody'll be able to help, i can pick apart the shaders in my shipset fairly well since i've been gawping at them for about 2 years so ships based on those we should be able to get working and soon enough you'll be writing out your own shader code!

Re: Show and Tell (new ships/ ships in progress)

Posted: Fri Jan 20, 2012 9:12 am
by MiMoriarty
if you're struggling with shaders and Materials won't do what you need just post a query in the 'Shaders Outpost' thread and somebody'll be able to help
Done :!:

Re: Show and Tell (new ships/ ships in progress)

Posted: Fri Jan 20, 2012 3:32 pm
by CaptSolo
MiMoriarty wrote:
CaptSolo wrote:
The important bit about shaders are:
1) Declaring the textures in the order wanted by the fragment shader
2) Creating the effects map with the correct RGB values

Study Griff's rocket shader example and his other OXP textures and you'll get the hang of it.


Okay...........what?
:lol:

I've had a hard time with Griff examples and still i can't figure how to make them work. I have also tried to use a griff's Python shipdata.plist with my own models faking the textures and it still didn't work. I'm bewildered.

Maybe it has something to do with the 3D model itself. Should it be normal mapped for the shaders to work?... I don't understand the fragment vertex code because I'm not programer and this's my real problem.
1) It has nothing to do with the 3D model
2) You don't need to bother with Griff's shader code and don't need to be a programmer.
3) It all hinges on how you make the effects map to get the glows from engine use, laser use and heated metal effect

As I understand it, the fragment shader reads the color channels from the effects texture to create glowing effects. The parts that are red are for the engines and produce a cyan glow, those that are green for the laser and produce a orange to red glow, and those that are blue for parts of your ship that glow because they are heated by the exhaust. Looking at Griff's Rocket Shader example in Shaders Outpost you can see parts of the fins glowing red because of contact with the exhaust plume.

The big question now is, "How in hell do I do that"? I can tell you briefly how I did it but Griff (and others) may have a better technique. All of my more recent models had engine nozzles, parts that stuck out the back from the engines, and laser cannons that protruded from the front and back. There's a funny story here about the lasers but will get to that later.
1) Open your diffuse texture in GIMP or whatever you use and save it to your Textures folder with a new filename (e.g. myship_effects.png)
2) Select the parts you want glowing effects, The engines, nozzles, and laser cannons if you have them. I use whatever selection tool is required but the important part is to set the selection mode to "ADD".
3) Once all parts selected, INVERSE the selection. This is important.
4) Set your foreground color to black (#000000).
5) Use the paint bucket tool or fill tool, set it to fill the entire selection, and fill to black.
Hard part done. Now all that remains are the parts you want glowing effects for. That is why we selected them and then inversed the selection so that only those parts remained. Now all you have to do is what GIMP calls, "Colorize".
1) Select the engines, similar to step 2 above. I like to use the Free Select tool and draw around the engines.
2) To eliminate the black I use what GIMP calls Fuzzy Select (or magic wand), set the threshold to zero and mode to subtract. Click on a black area to reduce the selection to just the engines.
3) Choose the colorize tool or whatever it's called in your graphics program. In GIMP it is under the colors menu.
4) Set the Hue to zero (red) and Saturation to maximum (100%). It is advisable to decrease the Lightness value but that depends on it's original values. Click OK to finish.
Repeat these steps for the laser and engine nozzles except for colorizing use these values:
Green: Hue=120
Blue: Hue=240
Like I said you may need to darken each area somewhat and save the finished texture. And if you want the shader files that I have used successfully just drop me a PM.

Griff likes to use a green gradient for his lasers and this is a good spot to tell you my story. I always wondered why Griff used subentities for his lasers and then one day I discovered why. I took my ship out for a test run and fired the forward laser. Yup, it works, as the laser went from grey to orange and finally red. Then I happened to be looking at the external view and noticed my aft laser was glowing as well but I had never fired it. :lol: