Outliners once again

Problems building or running the engine, queries about how to use features etc.
User avatar
paul424
Gnome
Posts: 377
Joined: Thu May 24, 2012 7:16 pm
x 18

Outliners once again

Post by paul424 »

Ogre Version: : 1 12 13:
Operating System: :Linux Tumbleweed:
Render System: :OpenGL3+

As I said there are two markers I work on : one outlner , one increasing the brightness.

The outliner looks like this :
https://postlmg.cc/0r7zM3B1

The simple pass through vertex program enlarges the mesh, the fragment vertex fills up the mesh with custom constant color.

I use the setDepthBias to make the inner mesh visible:

Code: Select all

 myOutliner->getTechnique(myOutliner->getNumTechniques() - 1)->getPass(ii)->setDepthBias(2, 256);

However there are many problems with this : one of them is some parts of the creature which should be hidden becomes visible :D
Like the Stone Troll on the picture above....
I tried various settings so far , but it seems that technique is too prmitive.
Shall I use the stancil buffer as one of the Ogre examples states ? The stencil buffer is calculated as the diffrence between the Outliner ( larger , outermost mesh ) projection and Orginal mesh ( smaller , innermost mesh) . And when I have the diffrence I fill it up with the desired colour, right ? OR my approach not so botched and I can fix it ? Advice something ....

User avatar
suny2000
Halfling
Posts: 89
Joined: Sun Sep 06, 2009 12:36 pm
x 18

Re: Outliners once again

Post by suny2000 »

How do you enlarge your mesh? Are you using the normals to push the vertex with a small offset?

Personnaly I tried this technique before and finally used a compositor technique using a Sobel filter to compute the outline. Not as efficient though.
S.

http://bulostudio.com: website and devlog of a small indie studio working on SHMUP CREATOR
https://twitter.com/bulostudio : follow me on twitter!
User avatar
paul424
Gnome
Posts: 377
Joined: Thu May 24, 2012 7:16 pm
x 18

Re: Outliners once again

Post by paul424 »

Code: Select all

#version 330 core
#extension GL_ARB_explicit_uniform_location : enable
#extension GL_ARB_shading_language_include : enable

layout (location = 0) in vec4 position;
layout (location = 2)  in vec4 normal;

uniform    mat4 worldViewProj;
uniform    vec3 center;

void main(void)
{
  vec3 pos =  position.xyz  - center;
  vec3 enlarged = pos*1.05 + center;
  gl_Position =worldViewProj * vec4(enlarged,1.0);
}

Where center is of course a center of a monster computed with OGre3d methods on the cpu.