Understanding visual effects

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

Moderators: winston, another_commander

User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Understanding visual effects

Post by Smivs »

This thread is a synthesis of posts from the Progress thread and the Shaders’ Outpost thread.
Ahruman wrote:
Ahruman wrote:
The overall goal here is to allow most of the effects used by Griff’s ships to be done without custom shaders.
I’d like to highlight the fact that this is awesome. :-)
It sounds it, but I have to confess I don't understand any of it :(
Will there be a guide or tutorial or something to help?
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Progress

Post by JensAyton »

I can only provide tools and specifications. We need the artiste himself to explain what the effect maps do. But obviously that requires the new stuff to be complete and the ships to be translated to it first.
User avatar
submersible
Commodore
Commodore
Posts: 264
Joined: Thu Nov 10, 2011 7:49 am

Re: Progress

Post by submersible »

Ahruman wrote:
I can only provide tools and specifications. We need the artiste himself to explain what the effect maps do. But obviously that requires the new stuff to be complete and the ships to be translated to it first.

I am only just beginning to come to grips with shaders and uv-mapping - if it were possible to blend between two materials using a map that would also be rather awesome.

And while I am requesting pie-in-the-sky features I have almost no hope of helping with.... emission / normal / specular / parallax maps for planets would be really quite awesome too.
User avatar
Okti
---- E L I T E ----
---- 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: Progress

Post by Okti »

Will transparency be supported?
My OXP's
And Latest Mission Coyote's Run
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Progress

Post by JensAyton »

Okti wrote:
Will transparency be supported?
No. This restriction has nothing to do with shaders.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Progress

Post by JensAyton »

As I said above, the goal (or rather, a goal) is to support most of what Griff’s ships do without requiring shaders. My main test is the Adder, which does most of the “normal” Griffly things without anything too exotic (like, say, the Thargoids and Morays).

Here is my current Adder material specification.
  • Diffuse colour, normal mapping and specular highlights work. As of r4780, this includes the metallic (self-colouring) effect thanks to the new self_color and scale_factor attributes.
  • I haven’t done anything for paint mapping or decals yet. I intend to do paint maps (and remove some of their current limitations). I’m not sure about decals.
  •  Also as of r4780, arbitrarily many light maps can be used, as shown. The conditional_color, binding, damage_flicker and simple_mode attributes aren’t implemented yet; when they are, the glows will respond to the environment in the same way as the standard Griff Adder. As it stands, you just get all four effects on full blast. All these light maps work like emission maps; adding illumination_mode = true turns them into illumination maps.
I realise there are a lot of weird magic words to take in at once. If you want to understand what’s going on here and don’t, please ask specific questions. :-)

Code: Select all

{
    diffuse_map = "oolite-adder-diffuse.png";
    normal_map = "oolite-adder-normal.png";
    specular_color_map =
    {
        name = "oolite-adder-diffuse.png";
        extract_channel = "a";
        self_color = true;  // Modulate specular colour with diffuse colour.
        scale_factor = 6;   // Multiply all channels by a constant.
    };
    specular_exponent = 5;
    
    light_map =
    (
        {
            // Light map 1: lamp/window glow map.
            name = "oolite-adder-effects.png";
            extract_channel = "a";
            
            // Base colour is yellow-white.
            color = (0.9926, 0.9686, 0.7325);
            
            // Turn red (and subtract base green and blue) in combat. Ignored in simple shader mode.
            conditional_color =
            {
                binding = "hasHostileTarget";
                color = (1.5, -0.4, -0.4);
            };
            
            // Flicker on and off while throwing sparks.
            damage_flicker = true;
        },
        {
            // Light map 2: cyan engine glow, full shaders only.
            name = "oolite-adder-effects.png";
            extract_channel = "b";
            color = (0.4, 1.4, 1.8);
            
            // Intensity is controlled by speedFactor.
            binding = "speedFactor";
            
            // Flicker on and off while throwing sparks.
            damage_flicker = true;
            
            // Disable in simple shader mode.
            simple_mode = false;
        },
        {
            // Light map 3: orange engine heat glow, full shaders only.
            name = "oolite-adder-effects.png";
            extract_channel = "r";
            color = (1.5, 0.55, 0.2);
            
            // Intensity is controlled by speedFactor.
            binding = "speedFactor";
            
            // Disable in simple shader mode.
            simple_mode = false;
        },
        {
            // Light map 4: red laser heat glow, full shaders only.
            name = "oolite-adder-effects.png";
            extract_channel = "g";
            color = (1.38, 0.35, 0.20);
            
            // Intensity is controlled by laser temperature.
            binding = "laserHeatLevel";
            
            // Disable in simple shader mode.
            simple_mode = false;
        }
    );
};
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Re: Progress

Post by DaddyHoggy »

Hi Ahruman, you wrote this: "...is to support most of what Griff’s ships do without requiring shaders"

But in the code I see this, in the comments:

Code: Select all

// Light map 2: cyan engine glow, full shaders only.
So, I don't understand what's different - apologies. (this could be because I never fully understood what Griff previously did with your earlier shady examples)
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Progress

Post by JensAyton »

The word “custom” seems to have disappeared.

In 1.76, you get Griffy ships you need to write GLSL. With this, you tell the game what you want and it writes shaders for you. To benefit, you still have to understand what you want, but you don’t need to handle the optics and pixels yourself.
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Re: Progress

Post by DaddyHoggy »

Ahruman wrote:
The word “custom” seems to have disappeared.

In 1.76, you get Griffy ships you need to write GLSL. With this, you tell the game what you want and it writes shaders for you. To benefit, you still have to understand what you want, but you don’t need to handle the optics and pixels yourself.
Thank-you. I actually do understand now!
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Progress

Post by JensAyton »

This is also something that could be relatively easily wrapped up in a third-party tool.

Of course, the last time someone tried to do that he ended up lead developer of Oolite. But that’s all right, we need a new one of those.
User avatar
Selezen
---- E L I T E ----
---- E L I T E ----
Posts: 2530
Joined: Tue Mar 29, 2005 9:14 am
Location: Tionisla
Contact:

Re: Progress

Post by Selezen »

This all sounds like it might actually make shaders accessible to my luddite brain.

Is there any chance of a step-by-step tutorial on how to create shaders under your new regime, Ahruman? Please? It sounds like the old tutorial may be dated now.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Progress

Post by Smivs »

Selezen wrote:
This all sounds like it might actually make shaders accessible to my luddite brain.

Is there any chance of a step-by-step tutorial on how to create shaders under your new regime, Ahruman? Please? It sounds like the old tutorial may be dated now.
This is something I would also appreciate, as I have no knowledge or understanding of such things. I would even like a simple explanation of the terminology and the functions of these things. Something like the code posted above for the adder but annotated/commented to describe the function of each element.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Progress

Post by JensAyton »

Selezen wrote:
This all sounds like it might actually make shaders accessible to my luddite brain.

Is there any chance of a step-by-step tutorial on how to create shaders under your new regime, Ahruman? Please? It sounds like the old tutorial may be dated now.
I’m not sure why this is so hard to explain, but the point of the material model is that you don’t create shaders. It has not been necessary to write shaders for the most common effects for the last five years.
User avatar
Selezen
---- E L I T E ----
---- E L I T E ----
Posts: 2530
Joined: Tue Mar 29, 2005 9:14 am
Location: Tionisla
Contact:

Re: Progress

Post by Selezen »

As I said. Luddite brain. Ug.

Change "create shaders" in my last post to "make shaders work"? Would that be more accurate?

This was my secondary reason for stopping doing OXPs - I didn't/don't understand how to get glow maps and reflections working.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Progress

Post by Svengali »

Smivs wrote:
Selezen wrote:
This all sounds like it might actually make shaders accessible to my luddite brain.

Is there any chance of a step-by-step tutorial on how to create shaders under your new regime, Ahruman? Please? It sounds like the old tutorial may be dated now.
This is something I would also appreciate, as I have no knowledge or understanding of such things. I would even like a simple explanation of the terminology and the functions of these things. Something like the code posted above for the adder but annotated/commented to describe the function of each element.
This was one of the reasons for the [wiki]Cabal_Common_MaterialsFinder[/wiki]. Play with the included example and you'll get a feeling for the possibilities pretty soon, specially when using it side by side with the [EliteWiki] documentation for the materials.
Post Reply