Hi All,
I was trying to find a way to change the textures of an entity. There are some OXP's doing that. But when I look at wiki, I could not find any documentation such as Textures for the shipdata.plist. and also files with .fragmentation is not documented at all. Any help on that will be apreciated.
Thanks
Okti
wiki seems to be out of date on certain topics
Moderators: winston, another_commander
Re: wiki seems to be out of date on certain topics
This page on the wiki is useful on the subject.
One such OXP which makes use of this is my Butterflies demo OXP. That one uses this technique to change the texture colour, but you can also use it to change the whole texture diffusion map.
Fragmentation sounds like shader stuff - time for the Griff signal
One such OXP which makes use of this is my Butterflies demo OXP. That one uses this technique to change the texture colour, but you can also use it to change the whole texture diffusion map.
Fragmentation sounds like shader stuff - time for the Griff signal

My OXPs via Boxspace or from my Wiki pages
.
Thargoid TV
Dropbox Referral Link

Thargoid TV
Dropbox Referral Link
- DaddyHoggy
- Intergalactic Spam Assassin
- Posts: 8515
- Joined: Tue Dec 05, 2006 9:43 pm
- Location: Newbury, UK
- Contact:
Re: wiki seems to be out of date on certain topics

Oolite Life is now revealed hereSelezen wrote:Apparently I was having a DaddyHoggy moment.
- Griff
- Oolite 2 Art Director
- Posts: 2495
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
Re: wiki seems to be out of date on certain topics

fragment & vertex shaders are written in GLSL http://en.wikipedia.org/wiki/GLSL (GLSL version 2.1 i think is what Oolite uses)
I don't really know much about the language but i can certainly write out how texture re-colouring is done in the shaders in my shipset if it's any help.
first in the shipdata.plist, we'll list the texture files, in this example a diffuse texture (or 'skin' texture) and a normal map
Code: Select all
textures =
(
"griff_adder_diffuse.png",
"griff_adder_normalmap.png"
);
Code: Select all
uniforms =
{
uColorMap = { type = texture; value = 0; };
uNormalMap = { type = texture; value = 1; };
};
Code: Select all
uniform sampler2D uColorMap;
uniform sampler2D uNormalMap;
Code: Select all
vec4 baseTex = texture2D(uColorMap, vTexCoord);
Code: Select all
float PaintMap = texture2D(uNormalMap, vTexCoord).a;

and add it into the baseTex
Code: Select all
baseTex += PaintMap * vec4(1.0, 0.5, 0.0, 1.0);
Code: Select all
gl_FragColor = vec4(baseTex);
Last edited by Griff on Sat Apr 09, 2011 9:56 pm, edited 1 time in total.
Wiki homepage for my OXP: http://wiki.alioth.net/index.php/Griff_Industries
- Okti
- ---- E L I T E ----
- Posts: 700
- Joined: Sun Sep 26, 2010 1:51 pm
- Location: A GH shop, near witchpoint to Oresrati in Galaxy 8
Re: wiki seems to be out of date on certain topics
Thanks for all the help,