Page 3 of 5

Posted: Thu Mar 13, 2008 1:04 pm
by Shion
We have added CEGUI to your sample and all works fine,
therefore I thought that the error is on our side.

I have tested our project many hours and I haven't found an error.
Therefore I have played a little bit with your code and have found out, that if you change some code, the Ogre text from the debug overlay is missing too.
(so you can reproduce the problem without CEGUI)

I need only the ogrehead with the glowing outlines,
thus I have removed the lines 135-161, because I don't need them.

If you try this, you can see that all text is missing.
I hope you can help us.

Posted: Fri Mar 14, 2008 1:07 am
by Assaf Raman
@Shion:
change line 32:
to
#define LAST_STENCIL_OP_RENDER_QUEUE RENDER_QUEUE_OUTLINE_GLOW_GLOWS
I disable the stencil check on a render queue called "LAST_STENCIL_OP_RENDER_QUEUE" when you removed all the entities that were on that render queue - "renderQueueEnded" was not fired for that queue because the queue was empty. The change described above changes the "LAST_STENCIL_OP_RENDER_QUEUE" number to be the same as your new last stencil queue.

I will be happy to help with any other problems you have with this sample.

[EDIT] I removed the from line - my two lines were the same as Shion wrote in the next post.

Posted: Fri Mar 14, 2008 8:57 am
by Shion
uuhhh..
Thank you very much, now it works. :)

Btw: your both codelines are the same xD

Posted: Fri Apr 04, 2008 9:32 pm
by sayad
The teeth glows can be reduced and the hole in the nose can be made darker. :)


Sayad

Posted: Tue Apr 29, 2008 2:27 pm
by hi_ferro
Hi! Nice work with the glow. I'm using it in a bigger production for the moment. It all worked perfect until i added animations to the Entity. The shader doesn't follow the animations. Is there some type of Update i can do?

Posted: Tue Jul 29, 2008 7:15 am
by Jian
hi_ferro wrote:Hi! Nice work with the glow. I'm using it in a bigger production for the moment. It all worked perfect until i added animations to the Entity. The shader doesn't follow the animations. Is there some type of Update i can do?
The glow is just another entity actually. You simply apply animation to both the glow and the original entity.

Posted: Mon Aug 11, 2008 2:15 am
by Shion
Hello I'm back again. 8)

And I have a new problem...
If I try your sample application I get some errors.

Code: Select all

02:59:57: glow_ps_glsl : GLSL compiled 

02:59:57: Cannot compile GLSL high-level shader : glow_vs_glsl (6) : error C0000: syntax error, unexpected ';', expecting ',' or 

')' at token ";"
(6) : error C0501: type name expected at token ";"
(8) : error C1066: invalid type in type constructor
(8) : error C0000: syntax error, unexpected ';', expecting ',' or ')' at token ";"
(8) : error C0501: type name expected at token ";"


02:59:57: An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 9
Function: GLSLProgram::loadFromSource
Description: Cannot compile GLSL high-level shader : glow_vs_glsl Cannot compile GLSL high-level shader : glow_vs_glsl (6) : error 

C0000: syntax error, unexpected ';', expecting ',' or ')' at token ";"
(6) : error C0501: type name expected at token ";"
(8) : error C1066: invalid type in type constructor
(8) : error C0000: syntax error, unexpected ';', expecting ',' or ')' at token ";"
(8) : error C0501: type name expected at token ";"

. 
File: \ogre\2003\ogre-win32-v1-2-3\ogrenew\RenderSystems\Gl\src\Glsl\src\OgreGLSLExtSupport.cpp
Line: 58
Stack unwinding: <<beginning of stack>>
02:59:57: High-level program glow_vs_glsl encountered an error during loading and is thus not supported.
Here some screenshots of the result.
Image
Image
Image

Have someone a idea or can fix this problem?


EDIT:
If I use the StencilGlow code with the newest Ogre version, I can't see anything.
The whole screen is black.

Posted: Wed Aug 13, 2008 9:55 pm
by Assaf Raman
I downloaded my project file it had none of the problems you reported.
Did you change the Cg to a different version?
Tell me more because I can't recreate your problem, with a clean 1.6 from the SVN and the project as is (I only needed to add ois.lib) - no problems...

Does anyone else have the same problem and can give us more info?

Posted: Thu Aug 14, 2008 5:44 pm
by Zero
Yes I have the same Problem.

1.) Shion mean with the lastest Version, Version 1.49.

2.) With Version 1.49 and OpenGL, I get these Errors:
18:22:10: Mesh: Loading ogrehead.mesh.
18:22:10: OGRE EXCEPTION(3:RenderingAPIException): Zero sized texture surface on texture WeirdEye.png face 0 mipmap 0. Probably, the GL driver refused to create the texture. in GLTexture::_createSurfaceList at ..\src\OgreGLTexture.cpp (line 380)
18:22:10: Error loading texture WeirdEye.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(3:RenderingAPIException): Zero sized texture surface on texture WeirdEye.png face 0 mipmap 0. Probably, the GL driver refused to create the texture. in GLTexture::_createSurfaceList at ..\src\OgreGLTexture.cpp (line 380)
18:22:10: OGRE EXCEPTION(3:RenderingAPIException): Zero sized texture surface on texture GreenSkin.jpg face 0 mipmap 0. Probably, the GL driver refused to create the texture. in GLTexture::_createSurfaceList at ..\src\OgreGLTexture.cpp (line 380)
18:22:10: Error loading texture GreenSkin.jpg. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(3:RenderingAPIException): Zero sized texture surface on texture GreenSkin.jpg face 0 mipmap 0. Probably, the GL driver refused to create the texture. in GLTexture::_createSurfaceList at ..\src\OgreGLTexture.cpp (line 380)
18:22:10: OGRE EXCEPTION(3:RenderingAPIException): Zero sized texture surface on texture spheremap.png face 0 mipmap 0. Probably, the GL driver refused to create the texture. in GLTexture::_createSurfaceList at ..\src\OgreGLTexture.cpp (line 380)
18:22:10: Error loading texture spheremap.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(3:RenderingAPIException): Zero sized texture surface on texture spheremap.png face 0 mipmap 0. Probably, the GL driver refused to create the texture. in GLTexture::_createSurfaceList at ..\src\OgreGLTexture.cpp (line 380)
18:22:10: OGRE EXCEPTION(3:RenderingAPIException): Zero sized texture surface on texture dirt01.jpg face 0 mipmap 0. Probably, the GL driver refused to create the texture. in GLTexture::_createSurfaceList at ..\src\OgreGLTexture.cpp (line 380)
18:22:10: Error loading texture dirt01.jpg. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(3:RenderingAPIException): Zero sized texture surface on texture dirt01.jpg face 0 mipmap 0. Probably, the GL driver refused to create the texture. in GLTexture::_createSurfaceList at ..\src\OgreGLTexture.cpp (line 380)
Image
You see here how it looks with OpenGl.

Image
This Screenshot is taken with DirectX. There you can see how it should look.

I hope you can help us!

Zero

Posted: Fri Aug 15, 2008 2:11 am
by Assaf Raman
Your problem was that you didn't copy the files in my zip to the right place.
I have updated the sample to make it easier for you.
1. Open this zip file.
2. Copy its content to OGRE SDK dir (on my computer it is C:\OgreSDK). The sample folder from the zip should add files to the existing sample folder and such.
3. Add the project file Demo_StencilGlow_vc8.vcproj from the path "samples\scripts" to Samples_vc8.sln solution.
4. Set the working directory in the debugging property tab of this project to "..\..\bin\$(ConfigurationName)" .
This should work.

Posted: Sat Aug 16, 2008 11:22 pm
by Shion
Ok, now it works.
Thx :)

Posted: Sat Aug 16, 2008 11:24 pm
by Assaf Raman
Good news. :D
I was happy to help.

Posted: Tue Aug 19, 2008 5:34 am
by lmas19820607
Sorry Assaf Raman, I can't use the links to download, can you fix it?

And I can't see any picture either...

Posted: Tue Aug 19, 2008 7:52 am
by Assaf Raman
Can you see this page: http://www.googlepages.com ?

Posted: Tue Aug 19, 2008 8:44 am
by Assaf Raman
I see from this thread - http://www.ogre3d.org/phpBB2/viewtopic.php?t=36950 that you are from china. I guess that google pages is blocked for you.
I will e-mail you the files if you want. Send me a PM with your e-mail.

Posted: Wed Aug 20, 2008 5:02 am
by lmas19820607
yep, I am from china, and china offical often forbid some ip from accessing or some web site forbid ip which is located in china.

thank you very much for your reply, now I know what the problem is. I can use proxy web server to download it.

Re: Stencil Glow Demo

Posted: Thu Aug 27, 2009 5:44 am
by LearnerPlates
Hi - bumping up an old thread here! :-)

I'm interested in using your technique to make a glow effect in a program I'm working on, but although the pre-compiled .exe works fine on my computer, when I build the demo code myself using Visual Studio 2008, I get the attached result. (It looks the same in DX and OpenGL)

My Ogre.log says the following:

Code: Select all

14:56:43: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/GenerateVS: CG ERROR : The compile returned an error.
(0) : error C6015: Output 'POSITION' not completely written
 in CgProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\plugins\cgprogrammanager\src\ogrecgprogrammanagerdll.cpp (line 66)
14:56:43: High-level program Ogre/ParticleGS/GenerateVS encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/GenerateVS: CG ERROR : The compile returned an error.
(0) : error C6015: Output 'POSITION' not completely written
 in CgProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\plugins\cgprogrammanager\src\ogrecgprogrammanagerdll.cpp (line 66)
14:56:43: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayVS: CG ERROR : The compile returned an error.
(249) : warning C7050: "output.color" might be used before being initialized
(0) : error C6015: Output 'POSITION' not completely written
 in CgProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\plugins\cgprogrammanager\src\ogrecgprogrammanagerdll.cpp (line 66)
14:56:43: High-level program Ogre/ParticleGS/DisplayVS encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayVS: CG ERROR : The compile returned an error.
(249) : warning C7050: "output.color" might be used before being initialized
(0) : error C6015: Output 'POSITION' not completely written
 in CgProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\plugins\cgprogrammanager\src\ogrecgprogrammanagerdll.cpp (line 66)
14:56:43: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayPS: CG ERROR : The compile returned an error.
(323) : fatal error C9999: unexpected cast operation
 in CgProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\plugins\cgprogrammanager\src\ogrecgprogrammanagerdll.cpp (line 66)
14:56:43: High-level program Ogre/ParticleGS/DisplayPS encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayPS: CG ERROR : The compile returned an error.
(323) : fatal error C9999: unexpected cast operation
 in CgProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\plugins\cgprogrammanager\src\ogrecgprogrammanagerdll.cpp (line 66)
and then...

Code: Select all

14:56:44: Can't assign material cg/glow to SubEntity of outlineGlow_glow because this Material does not exist. Have you forgotten to define it in a .material script?
14:56:44: Can't assign material cg/glow to SubEntity of outlineGlow_glow because this Material does not exist. Have you forgotten to define it in a .material script?
14:56:44: Can't assign material cg/glow to SubEntity of outlineGlow_glow because this Material does not exist. Have you forgotten to define it in a .material script?
14:56:44: Can't assign material cg/glow to SubEntity of outlineGlow_glow because this Material does not exist. Have you forgotten to define it in a .material script?
14:56:44: Can't assign material cg/alpha_glow to SubEntity of fullGlowEntity_alphaGlow because this Material does not exist. Have you forgotten to define it in a .material script?
14:56:44: Can't assign material cg/alpha_glow to SubEntity of fullGlowEntity_alphaGlow because this Material does not exist. Have you forgotten to define it in a .material script?
14:56:44: Can't assign material cg/alpha_glow to SubEntity of fullGlowEntity_alphaGlow because this Material does not exist. Have you forgotten to define it in a .material script?
14:56:44: Can't assign material cg/alpha_glow to SubEntity of fullGlowEntity_alphaGlow because this Material does not exist. Have you forgotten to define it in a .material script?
14:56:44: Can't assign material cg/no_depth_check_glow to SubEntity of fullGlowEntity_glow because this Material does not exist. Have you forgotten to define it in a .material script?
14:56:44: Can't assign material cg/no_depth_check_glow to SubEntity of fullGlowEntity_glow because this Material does not exist. Have you forgotten to define it in a .material script?
14:56:44: Can't assign material cg/no_depth_check_glow to SubEntity of fullGlowEntity_glow because this Material does not exist. Have you forgotten to define it in a .material script?
14:56:44: Can't assign material cg/no_depth_check_glow to SubEntity of fullGlowEntity_glow because this Material does not exist. Have you forgotten to define it in a .material script?
Can someone more knowledgeable than me explain what this means and tell me if I've done something wrong?

Re: Stencil Glow Demo

Posted: Thu Aug 27, 2009 9:33 am
by Assaf Raman
The errors in the first quote are unrelated to this sample, and the errors in the second quote imply that you didn't add the sample materials to the resources.

Re: Stencil Glow Demo

Posted: Thu Aug 27, 2009 1:31 pm
by LearnerPlates
Thanks for your help, Assaf! The problem was that the files had been unzipped to OgreSDK/Samples/Media instead of OgreSDK/Media. I'm still very new to this, as you can no doubt tell. ;-) It works perfectly now.

Re: Stencil Glow Demo

Posted: Thu Aug 27, 2009 1:39 pm
by Assaf Raman
No prob. :D

Re: Stencil Glow Demo

Posted: Fri Aug 28, 2009 12:50 pm
by moadib
Is it possible to friends this technique with stencil shadows? It work fine until i turn on stencil shadows.

Re: Stencil Glow Demo

Posted: Sun Oct 25, 2009 7:13 pm
by Lastmerlin
When starting the demo I get:
WARNING: material cg/glow has no supportable Techniques and will be blank. Explanation:
Pass 0: Vertex program glow_vs_cg cannot be used - not supported.

WARNING: material cg/alpha_glow has no supportable Techniques and will be blank. Explanation:
Pass 0: Vertex program glow_vs_cg cannot be used - not supported.

WARNING: material cg/no_depth_check_glow has no supportable Techniques and will be blank. Explanation:
Pass 0: Fragment program glow_ps_cg cannot be used - not supported.
Sound clearly like *your graphic card is too bad*.
In contrast to that, the Ogre startup log says that fragment and vertex programs are available:

Code: Select all

RenderSystem capabilities
-------------------------
 * Hardware generation of mipmaps: yes
 * Texture blending: yes
 * Anisotropic texture filtering: yes
 * Dot product texture operation: yes
 * Cube mapping: yes
 * Hardware stencil buffer: yes
   - Stencil depth: 8
   - Two sided stencil support: no
   - Wrap stencil values: yes
 * Hardware vertex / index buffers: yes
 * Vertex programs: yes
   - Max vertex program version: arbvp1
 * Fragment programs: yes
   - Max fragment program version: arbfp1
 * Texture Compression: yes
   - DXT: no
   - VTC: no
 * Scissor Rectangle: yes
 * Hardware Occlusion Query: no
 * User clip planes: yes
 * VET_UBYTE4 vertex element type: yes
 * Infinite far plane projection: yes
 * Hardware render-to-texture: no
 * Floating point textures: no
 * Non-power-of-two textures: no
 * Volume textures: yes
 * Multiple Render Targets: 1
 * Point Sprites: no
 * Extended point parameters: yes
 * Max Point Size: 255
 * Vertex texture fetch: no
Did I miss some include / plugin / ressource or is it just my hardware that doesnt support the shaders programs ?
Some more information on Hardware:
GL_VERSION = 1.3 Mesa 7.0.1
GL_VENDOR = Tungsten Graphics, Inc
GL_RENDERER = Mesa DRI Intel(R) 945GM 20061017 x86/MMX/SSE2

Re: Stencil Glow Demo

Posted: Sun Oct 25, 2009 7:18 pm
by xavier
You need to install the Intel hardware drivers for your chipset -- Mesa is a software renderer.

There are many different levels of vertex and fragment program -- that log snippet is saying that the Mesa drivers support the lowest level (i.e. GeForce3/4), which will not be enough to run most of the demos.

Re: Stencil Glow Demo

Posted: Sun Oct 25, 2009 7:41 pm
by Lastmerlin
Thank you !
How can I determine at runtime if a given hardware is capable to use the required scripts ? Just checking the Rendersystem Capabilities seems not precise enough.

It is possible to get this demo running without these scripts ? As far as I see there are two of them: The first one change the position of a Fragment and the second one gives a color. At least for the second one it should be possible to substitute it to avoid the use of scripts.
The aim is, that my program doesn't crash if there are some missing hardware capabilities. Its ok if certain feature are missing or not so nice in this case.

One word to mesa: I am using the xf86-video-intel driver for my linux distribution. I dont believe that this is pure software rendering. Software rendering is usually noticable by extremely low speed and glxinfo states that direct rendering is used.
Mesa homepage says:
A variety of device drivers allows Mesa to be used in many different environments ranging from software emulation to complete hardware acceleration for modern GPUs.
Doesn't sound like software emulation either. I think this rather says that software emulation is used if no proper hardware is available.
And the most difficult point about the driver is: I have no idea what I should use else. Everyone uses the xf86-video-intel one. I anyone has a better idea: Please tell me - i'd be very grateful :)

Re: Stencil Glow Demo

Posted: Sun Oct 25, 2009 8:57 pm
by xavier
Lastmerlin wrote:Thank you !
How can I determine at runtime if a given hardware is capable to use the required scripts ?

Just checking the Rendersystem Capabilities seems not precise enough.
What most Ogre users do is provide more than one technique in their materials -- Ogre will fall back to the best technique that matches the hardware present. Beyond that it depends on what capabilities you need beyond what the rendersystem caps provides you.
It is possible to get this demo running without these scripts ?
I have no idea, because I did not write the demo nor am I familiar with it at all, but if the shaders used require GPU levels above arb[vp|fp]1 then the answer is no.
One word to mesa: I am using the xf86-video-intel driver for my linux distribution. I dont believe that this is pure software rendering. Software rendering is usually noticable by extremely low speed and glxinfo states that direct rendering is used.
Mesa homepage says:
A variety of device drivers allows Mesa to be used in many different environments ranging from software emulation to complete hardware acceleration for modern GPUs.
Doesn't sound like software emulation either. I think this rather says that software emulation is used if no proper hardware is available.
And the most difficult point about the driver is: I have no idea what I should use else. Everyone uses the xf86-video-intel one. I anyone has a better idea: Please tell me - i'd be very grateful :)

If that's all that's available for Linux (and looking at the Intel site, it is), and assuming that the drivers are actually written by Intel engineers (and it appears they are), then what you have is what there is.

You need to understand that Intel embedded graphics are not intended to be the most powerful thing in the world -- they have roughly the same available features as a GeForce 3 card -- and that's 9-year-old hardware now. And even though they have SM2.0 capabilities, that does you no good on Linux, since you are stuck with OpenGL and whatever the ARB decides is available for a given GL version and "GL_VERSION = 1.3 Mesa 7.0.1" is ancient now too -- the current GL version is 3+).

In other words, I would be happy that Ogre runs at all, and if you need more advanced features, you need to use a desktop or other machine where you have access to better GPUs.


Now.

All that said, you are free to try to rewrite the shaders in direct GLSL (and insert techniques using those shaders into the materials used by this demo), and query the GL strings to find out what is available on the target platform, but is it really that important that this specific demo run on an intel embedded chipset under Linux?