The Dream Team - Revisited
Moderators: winston, another_commander
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Since we’re talking about chitin and stuff, I should probably point out that the next Windows release (like the 1.67 Mac releases) will support pixel shaders. When I get home I’ll post the freaky-thargoids demo OXP somewhere for reference. I’ll try to throw together a specular map example, too.
E-mail: [email protected]
- Killer Wolf
- ---- E L I T E ----
- Posts: 2278
- Joined: Tue Jan 02, 2007 12:38 pm
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Nope, in the current implementation you must code the shader in GLSL… or copy and paste from someone else.
A simpler approach – where you specify a number of effect maps, and Oolite builds an appropriate shader, scaling down complexity to what the hardware can handle if necessary – is on my “things I’d like to do” list. It comes after “Operation Major Surgery”, and isn’t likely to materialize for at least several months. When/if it does, existing custom shaders will continue to work.
A simpler approach – where you specify a number of effect maps, and Oolite builds an appropriate shader, scaling down complexity to what the hardware can handle if necessary – is on my “things I’d like to do” list. It comes after “Operation Major Surgery”, and isn’t likely to materialize for at least several months. When/if it does, existing custom shaders will continue to work.
E-mail: [email protected]
- Star Gazer
- ---- E L I T E ----
- Posts: 633
- Joined: Sat Aug 14, 2004 4:55 pm
- Location: North Norfolk, UK, (Average Agricultural, Feudal States,Tech Level 8)
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
I’ve posted the Freaky Thargoids OXP to the wiki. I’m working on an overview of fragment shaders as they apply to Oolite.
E-mail: [email protected]
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Overview thingy done (with a terse explanation of the Freaky Thargoids shader code). In the process, I found (via Wikipedia) an article on normal mapping for artists, which might be considered somewhat depressing since (I believe) the current shader implementation is not usable for that form of normal mapping, but it begins with a good description of how lighting in 3D works, which should help understand how smoothing currently works in Oolite.
I’m actually about to modify the way shader loading works, in a way that breaks compatibility; the current version of freaky-thargoids, or anything based on it, will not use shaders in future releases. However, modifying it to work will be easy, so if you want to start playing with shaders, don’t let this put you off.
I’m actually about to modify the way shader loading works, in a way that breaks compatibility; the current version of freaky-thargoids, or anything based on it, will not use shaders in future releases. However, modifying it to work will be easy, so if you want to start playing with shaders, don’t let this put you off.
E-mail: [email protected]
- Killer Wolf
- ---- E L I T E ----
- Posts: 2278
- Joined: Tue Jan 02, 2007 12:38 pm
- Arexack_Heretic
- Dangerous Subversive Element
- Posts: 1876
- Joined: Tue Jun 07, 2005 7:32 pm
- Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
- Contact:
I wasn't aware it already worked ingame. this is great.
edit: Ah I see from the next (1.67) release it will work.
Also if I understand correctly, what the code does is replacing a given texture file for the described shader version?
ie Giles mentioned the Thargorn looked pretty freaky, BECAUSE it used the standard in-game thargoid.png.
This could mean one could suffice with defining a shader once in a shipdata....(but also that it would be advisable to copy-rename textures if creating custom shayders based on standard textures)
Or just define a fictitious texture to be 'replaced'.
Don't forget the PPC25.oxp which utilises shayders coupled to engine-level.
PPC25:
edit: Ah I see from the next (1.67) release it will work.
Also if I understand correctly, what the code does is replacing a given texture file for the described shader version?
ie Giles mentioned the Thargorn looked pretty freaky, BECAUSE it used the standard in-game thargoid.png.
This could mean one could suffice with defining a shader once in a shipdata....(but also that it would be advisable to copy-rename textures if creating custom shayders based on standard textures)
Or just define a fictitious texture to be 'replaced'.
Don't forget the PPC25.oxp which utilises shayders coupled to engine-level.
PPC25:
Code: Select all
<key>shaders</key>
<dict>
<key>pccv25hull.png</key><!-- replace this texture -->
<dict>
<key>textures</key>
<array>
<string>pccv25hull.png</string><!-- passed as tex0 -->
<string>pccv25-hullg.png</string><!-- passed as tex1 -->
<string>pccv25-hulleg.png</string><!-- passed as tex2 -->
</array>
<key>glsl</key><!-- fragment shader code - adds tex1 as a glowmap and tex2 as an engine level glow -->
<string>
uniform sampler2D tex0;
uniform sampler2D tex1;
uniform sampler2D tex2;
uniform float engine_level;
void main()
{
vec4 base = texture2D(tex0, gl_TexCoord[0].st);
vec4 glow1 = texture2D(tex1, gl_TexCoord[0].st);
vec4 glow2 = texture2D(tex2, gl_TexCoord[0].st);
gl_FragColor = gl_Color * base + glow1 * glow1.a + glow2 * glow2.a * engine_level;
}
</string>
</dict>
<key>pccv25engine.png</key><!-- replace this texture -->
<dict>
<key>textures</key>
<array>
<string>pccv25engine.png</string><!-- passed as tex0 -->
<string>pccv25-engineeg.png</string><!-- passed as tex1 -->
</array>
<key>glsl</key><!-- fragment shader code - adds tex1 as an engine level glow -->
<string>
uniform sampler2D tex0;
uniform sampler2D tex1;
uniform float engine_level;
void main()
{
vec4 base = texture2D(tex0, gl_TexCoord[0].st);
vec4 glow2 = texture2D(tex1, gl_TexCoord[0].st);
gl_FragColor = gl_Color * base + glow2 * glow2.a * engine_level;
}
</string>
</dict>
Last edited by Arexack_Heretic on Thu Mar 22, 2007 8:50 pm, edited 1 time in total.
Riding the Rocket!
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
I was mistaken. The modifications I needed to make have been completed without breaking backwards compatibility. Future versions of Oolite will be able to use shaders embedded in shipdata.plist or in an external file (which should be more efficient when using the same shader for multiple ships, although this is not yet the case).
I’ve updated freaky-thargoids to support lighting. (The previous one essentially had two glow maps mixed together, rather than a colour map + glow map.) This version also uses vertex shaders.
I’ve updated freaky-thargoids to support lighting. (The previous one essentially had two glow maps mixed together, rather than a colour map + glow map.) This version also uses vertex shaders.
Really? Where can I find that?Arexack_Heretic wrote:Don't forget the PPC25.oxp which utilises shayders coupled to engine-level.
E-mail: [email protected]
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
A shader replaces a texture for a specific ship. It doesn’t replace every use of a given texture. Oh, and there’s no “y” in “shader”. :-)Arexack_Heretic wrote:Also if I understand correctly, what the code does is replacing a given texture file for the described shader version?
ie Giles mentioned the Thargorn looked pretty freaky, BECAUSE it used the standard in-game thargoid.png.
E-mail: [email protected]
- Arexack_Heretic
- Dangerous Subversive Element
- Posts: 1876
- Joined: Tue Jun 07, 2005 7:32 pm
- Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
- Contact:
ppc25.
not on oosat(2)?
I'll upload it from my HDD if it needs replacing.
uploading now...
hmm...no longer instantaneous.
Where did the wrex teaser v1.2 go BTW? There's only an old version posted by LB there. I'm sure I updated it not too long ago....
It is one of the last works of Giles.
(Famous last works)
Shayders: yes, i know you pedantic...:p it is a personal joke. I misheard Giles the first time I saw his shader-movie.
If the shaders are entry specific, then he must have spliced the freaky-texture-code into my shipdata.
not on oosat(2)?
I'll upload it from my HDD if it needs replacing.
uploading now...
hmm...no longer instantaneous.
Where did the wrex teaser v1.2 go BTW? There's only an old version posted by LB there. I'm sure I updated it not too long ago....
It is one of the last works of Giles.
(Famous last works)
Shayders: yes, i know you pedantic...:p it is a personal joke. I misheard Giles the first time I saw his shader-movie.
If the shaders are entry specific, then he must have spliced the freaky-texture-code into my shipdata.
Riding the Rocket!
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Hmm… perhaps they’re not. They’re just specified on a per-ship basis to confuse people.
This is part of a complex set of issues that needs dealing with (I believe I’ve alluded to it before…) I reccomend not relying on this behaviour.
This is part of a complex set of issues that needs dealing with (I believe I’ve alluded to it before…) I reccomend not relying on this behaviour.
E-mail: [email protected]
- Arexack_Heretic
- Dangerous Subversive Element
- Posts: 1876
- Joined: Tue Jun 07, 2005 7:32 pm
- Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
- Contact:
Do uploads to OOsat2 now need special clearance from someone?
I uploaded PPC25 and wrex_teaser1.2, but cannot see them. (nor do the pictures work. strange)
edit:
I updated the wiki as well.
I uploaded PPC25 and wrex_teaser1.2, but cannot see them. (nor do the pictures work. strange)
edit:
I updated the wiki as well.
Last edited by Arexack_Heretic on Thu Mar 22, 2007 10:43 pm, edited 2 times in total.
Riding the Rocket!
- Uncle Reno
- ---- E L I T E ----
- Posts: 648
- Joined: Mon Apr 24, 2006 12:54 pm
- Location: UK
Yes, Oosat2 uploads need to be approved by Winston. The idea is that we migrate over to the Wiki but I'm encountering a file size limit at the moment.
"Get back or I unleash my lethal spotted batoid!!"
What I do when not reading the Oolite bulletin board!
What I do when not reading the Oolite bulletin board!