please explain Ogre lighting model

Problems building or running the engine, queries about how to use features etc.
slapin
Bronze Sponsor
Bronze Sponsor
Posts: 146
Joined: Fri May 23, 2025 5:04 pm
x 5

please explain Ogre lighting model

Post by slapin »

Hi, all!
I still struggle with Ogre materials as on every stage I think I understand them something happens and I know I don't.
as I understand Ogre simulates fixed function pipeline without PBR support with only ambient/diffuse/specular/emission.
All of these depend on light source except for ambient (which still won't do what I want)...
I found the solution for debug materials but not skybox material.

Code: Select all

material Debug/Red
{
        technique
        {
                pass
                {
                        lighting off
                        depth_check on
                        depth_write on
                        depth_func always_pass
                        ambient 1.0 0.0 0.0 1.0
                        diffuse vertexcolour
                        specular 0.0 0.0 0.0 1.0
                        cull_software none
                        cull_hardware none
                }
        }
}

The above code generates red material which passes through everything only when I set vertex color to red.
any attempts in making diffuse or ambient work failed. Red texture image works too. But whatever colors I set in
the material script are ignored.
Also when I put this material on skybox, it displays black+yellow spots. Please help me understand.

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 146
Joined: Fri May 23, 2025 5:04 pm
x 5

Re: please explain Ogre lighting model

Post by slapin »

And a follow-up question - if I need my custom shader program, I have to implement it separately for each render system, right?
is there no unified shading language? No cross-language support?

paroj
OGRE Team Member
OGRE Team Member
Posts: 2204
Joined: Sun Mar 30, 2014 2:51 pm
x 1188

Re: please explain Ogre lighting model

Post by paroj »