Shaders’ Outpost

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

1) that’s a convex surface.
2) on flat surfaces, you don’t get small highlights like that (unless the light source is up close); the entire surface lights up if the angle is right.

I suspect, though, that Griff’s revised fuel leak would look less strange on a moving object. Still, I’d reduce the exponent slightly.
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

come to think of it, the fuel leak does look like a hole in the object! might be a cool idea to tie that effect to a variable of some sort and get it to spread out across the surface of the ship until it becames totally dark and glossy like some sort of cloaking device effect or something, maybe tie it into the engine_level so as it accelerates it transforms?
User avatar
Arexack_Heretic
Dangerous Subversive Element
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:

Post by Arexack_Heretic »

@Ahr.
You are right. I always mix those two up. :duh:
And I know about 'flat' surfaces reflecting. :p

The 'invisible' effect is mainly from the similarity to the background colour, I think.
So be sure to have some way of sampling the ambient colours.

I'm sure ray-tracing (or whatever it is called) is not what we are using here to give reflections and such.
Riding the Rocket!
User avatar
Arexack_Heretic
Dangerous Subversive Element
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:

Post by Arexack_Heretic »

Say, with spawnTime(floatingpoint) now available (v1.69), the glowy_alloys can decay over time can they not?
Riding the Rocket!
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Yes. I’m working on that demo, alongside some other stuff. :-) (It uses timeElapsedSinceSpawn, though.)
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

As promised, an updated version of Griff’s glowing alloy (the original version with only one model, for simplicity), demonstrating new 1.69 features. Noteworthy stuff:
  • Uses a uniform binding to “cool down” over time (specifically, 45 seconds).
  • No texture duplication. The material key/non-shader diffuse map may now be used as a texture provided to the shader.
  • Files now have somewhat sensible names. The next person to release something called “alloy1.dat” gets it up the posterior.
  • shipdata.plist is in OpenStep format rather than XML. This should mostly work, although it’s possible that there are some keys that won’t work this way.
I also changed the MetalGlow function. It’s similar to the temperature glow function from the Shady Cobra, but redder. The function fades from white through yellow and red to black, rather than maintaining the same hue; this provides a much better approximation of the behaviour of cooling metal. (For realism, the temperature should really have exponential falloff rather than linearly fading.)

Artistically, I think it would look better if the burned areas were charred into the metal (blackened in the diffuse map, low specularity).

Edit: edited for clarity.
Edit: edited for spelling.
Last edited by JensAyton on Wed Oct 22, 2008 8:53 pm, edited 3 times in total.
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

not being able to see the changes in colour your shader code would generate from different values of the 'heat' variable was always a big dissapointment in that release of the glowingalloys.oxp.
That's a great idea about scorching the hottest areas of the surface too, i'll rework the textures to add this in i think.

edited to remove far too many occurances of the word "great!"
User avatar
Uncle Reno
---- E L I T E ----
---- E L I T E ----
Posts: 648
Joined: Mon Apr 24, 2006 12:54 pm
Location: UK

Post by Uncle Reno »

Ahruman wrote:
As promised, an updated version of Griff’s glowing alloy (the original version with only one model, for simplicity).
I get a message at the Oolite start screen that this OXP isn't compatible with 1.68, is this a problem. :?
"Get back or I unleash my lethal spotted batoid!!"

What I do when not reading the Oolite bulletin board!
United Blobs
Competent
Competent
Posts: 45
Joined: Sat Mar 24, 2007 7:51 pm

Post by United Blobs »

According to the wiki page on uniform bindings (as linked in Ahruman's post):
The information presented on this page applies to Oolite test release 1.69 and later.
So unless you're using the unreleased v1.69 then you can't use it.
User avatar
Uncle Reno
---- E L I T E ----
---- E L I T E ----
Posts: 648
Joined: Mon Apr 24, 2006 12:54 pm
Location: UK

Post by Uncle Reno »

Whoops, sorry :oops: , obviously not paying attention. :roll:

Thanks for the answer United Blobs.
"Get back or I unleash my lethal spotted batoid!!"

What I do when not reading the Oolite bulletin board!
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

sorry, i added to the confusion there. i was looking at the Ahruman shader in a program called rendermonkey, it allows you to add 'slider' type controls to variables, i'd linked one of these to the 'time' variable and was able to see the cooling effect by interactively moving the slider.
User avatar
Uncle Reno
---- E L I T E ----
---- E L I T E ----
Posts: 648
Joined: Mon Apr 24, 2006 12:54 pm
Location: UK

Post by Uncle Reno »

No worrys Griff, I was obviously too eager. It sounded cool, I knew I wouldn't understand all the detail so didn't read too closely, downloaded the OXP and dumped it into my AddOns folder. I obviously looked after I leapt! :)
"Get back or I unleash my lethal spotted batoid!!"

What I do when not reading the Oolite bulletin board!
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

I’ve decided to deprecate the old fixed set of uniforms: engine_level, entity_personality, entity_personality_int, hull_heat_level, laser_heat_level and time. These will be supported transitionally in 1.69, and removed in future releases. The same functionality can be achieved using property bindings in 1.69 and later. For instance, if you use time, you will need to add the following code to your shader dictionary in shipinfo.plist (no shader change required):

Code: Select all

uniforms =
{ 
    time = universalTime;
}
or in XML:

Code: Select all

<key>uniforms</key>
<dict>
    <key>time</key>
    <dict>
        <key>time</key> <string>universalTime</string>
    </dict>
</dict>
At the same time, the relevant uniform availability macros will be removed: OO_ENGINE_LEVEL, OO_ENTITY_PERSONALITY, OO_ENTITY_PERSONALITY_INT, OO_ENTITY_LASER_HEAT_LEVEL, OO_HULL_HEAT_LEVEL, OO_TIME.

Edit: The examples above use a simplified binding declaration syntax, and the wiki page has been updated to reflect this. To support this change, it is no longer possible to declare constant numerical uniforms with similar abbreviated syntax. I believe this was only done in Freaky Thargoids, which will be updated once 1.69 is out.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Freaky Thargoids has been updated for 1.69. In addition to using an explicit binding for the time, it also does away with the redundant copies of textures.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Do shader bindings work in 1.69 under Windows? For instance, does the new version of Freaky Thargoids work, and the fading-over-time version of glowing alloy? (In the latter case, reducing the decay time in the shader might be helpful for testing.)
Last edited by JensAyton on Sat Jul 07, 2007 5:08 pm, edited 1 time in total.
Post Reply