Stencil Glow Demo

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
Lastmerlin
Halfling
Posts: 74
Joined: Sun Nov 11, 2007 4:43 pm

Re: Stencil Glow Demo

Post by Lastmerlin » Sun Oct 25, 2009 10:18 pm

xavier wrote: 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.
Ok then you can provide a dummy technique that looks much worse but at least it works. Alternatively you can use getNumSupportedTechniques to check if there are supported techniques. Did I get this correctly ?
xavier wrote: 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?
I am aware that this graphic card is low-end. My friends refer to it as *not a real graphic card* :D . Its my secondary computer and I have made only commandline and simple GUI programs with it before using Ogre. I am definitely not blaming the demo if some advanced features are not working.
What I want is to maintain the property of our game to run on even older hardware as much as possible. That means that I have to identify not supported features and either switch them off or replace them with something less demanding .

I will test it with my other computer (this one has a *real* graphic card) tomorrow.
0 x

User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US

Re: Stencil Glow Demo

Post by xavier » Sun Oct 25, 2009 10:22 pm

Lastmerlin wrote:
xavier wrote: 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.
Ok then you can provide a dummy technique that looks much worse but at least it works. Alternatively you can use getNumSupportedTechniques to check if there are supported techniques. Did I get this correctly ?
If you don't care that the absolute fallback is always BaseWhite, then you don't even need to check. If the demo crashes then that's a bad demo -- Ogre doesn't crash in this case, there is *always* BaseWhite when no other techniques work.
0 x
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.

ppClarity
Gremlin
Posts: 194
Joined: Sat Sep 02, 2006 12:27 am

Re: Stencil Glow Demo

Post by ppClarity » Mon Oct 26, 2009 5:42 am

xavier wrote:You need to install the Intel hardware drivers for your chipset -- Mesa is a software renderer.
Xorg also uses Mesa to provides the GL frontend for hardware.

The following page should help you determine if your configuration is good.
http://dri.freedesktop.org/wiki/glxinfo
GL_RENDERER = Mesa DRI Intel(R) 945GM 20061017 x86/MMX/SSE2
However... this is wretchedly old. For the 9xx series Intel chips you'll want a fairly recent distro like Ubuntu 9.04 or Fedora Core 11 or 12 to get the most performance you can ( and as you know those chips need all the help they can get :lol: )
0 x

Lastmerlin
Halfling
Posts: 74
Joined: Sun Nov 11, 2007 4:43 pm

Re: Stencil Glow Demo

Post by Lastmerlin » Mon Oct 26, 2009 10:47 am

offtopic: I tried ubuntu 9.04 a few weeks ago. Result was a disaster. Just google for {ubuntu 9.04 intel} and you will discover that their new driver is completely screwed. I am waiting for 9.10 now.

ontopic:

Tried the demo on my other computer, with a *real* graphic card (Radeon HD 4550). This is not upper class as well but it works well for me and I do not intend to get a new one soon. So no *get a new graphic card* comments this time please.

glxinfo output:

Code: Select all

name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: ATI
server glx version string: 1.4
server glx extensions:
    GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_OML_swap_method,
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
    GLX_SGIX_visual_select_group
client glx vendor string: ATI
client glx version string: 1.4
client glx extensions:
    GLX_ARB_create_context, GLX_ARB_get_proc_address, GLX_ARB_multisample,
    GLX_EXT_import_context, GLX_EXT_visual_info, GLX_EXT_visual_rating,
    GLX_MESA_allocate_memory, GLX_MESA_swap_control,
    GLX_MESA_swap_frame_usage, GLX_NV_swap_group, GLX_OML_swap_method,
    GLX_OML_sync_control, GLX_SGI_make_current_read, GLX_SGI_swap_control,
    GLX_SGI_video_sync, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
    GLX_SGIX_pbuffer, GLX_SGIX_swap_barrier, GLX_SGIX_swap_group,
    GLX_SGIX_visual_select_group, GLX_EXT_texture_from_pixmap
GLX version: 1.4
GLX extensions:
    GLX_ARB_create_context, GLX_ARB_get_proc_address, GLX_ARB_multisample,
    GLX_EXT_import_context, GLX_EXT_visual_info, GLX_EXT_visual_rating,
    GLX_MESA_swap_control, GLX_NV_swap_group, GLX_OML_swap_method,
    GLX_SGI_video_sync, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
    GLX_SGIX_swap_barrier, GLX_SGIX_swap_group, GLX_SGIX_visual_select_group
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: ATI Radeon HD 4550
OpenGL version string: 2.1.8591
OpenGL extensions:
    GL_AMDX_vertex_shader_tessellator, GL_AMD_performance_monitor,
    GL_AMD_texture_texture4, GL_ARB_color_buffer_float,
    GL_ARB_depth_buffer_float, GL_ARB_depth_texture, GL_ARB_draw_buffers,
    GL_ARB_draw_instanced, GL_ARB_fragment_program,
    GL_ARB_fragment_program_shadow, GL_ARB_fragment_shader,
    GL_ARB_framebuffer_object, GL_ARB_framebuffer_sRGB,
    GL_ARB_half_float_pixel, GL_ARB_half_float_vertex,
    GL_ARB_instanced_arrays, GL_ARB_map_buffer_range, GL_ARB_multisample,
    GL_ARB_multitexture, GL_ARB_occlusion_query, GL_ARB_pixel_buffer_object,
    GL_ARB_point_parameters, GL_ARB_point_sprite, GL_ARB_shader_objects,
    GL_ARB_shader_texture_lod, GL_ARB_shading_language_100, GL_ARB_shadow,
    GL_ARB_shadow_ambient, GL_ARB_texture_border_clamp,
    GL_ARB_texture_buffer_object, GL_ARB_texture_compression,
    GL_ARB_texture_compression_rgtc, GL_ARB_texture_cube_map,
    GL_ARB_texture_env_add, GL_ARB_texture_env_combine,
    GL_ARB_texture_env_crossbar, GL_ARB_texture_env_dot3,
    GL_ARB_texture_float, GL_ARB_texture_mirrored_repeat,
    GL_ARB_texture_non_power_of_two, GL_ARB_texture_rectangle,
    GL_ARB_texture_rg, GL_ARB_transpose_matrix, GL_ARB_vertex_array_object,
    GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_vertex_shader,
    GL_ARB_window_pos, GL_ATI_draw_buffers, GL_ATI_envmap_bumpmap,
    GL_ATI_fragment_shader, GL_ATI_meminfo, GL_ATI_separate_stencil,
    GL_ATI_texture_compression_3dc, GL_ATI_texture_env_combine3,
    GL_ATI_texture_float, GL_EXT_abgr, GL_EXT_bgra, GL_EXT_bindable_uniform,
    GL_EXT_blend_color, GL_EXT_blend_equation_separate,
    GL_EXT_blend_func_separate, GL_EXT_blend_minmax, GL_EXT_blend_subtract,
    GL_EXT_compiled_vertex_array, GL_EXT_copy_buffer, GL_EXT_copy_texture,
    GL_EXT_draw_buffers2, GL_EXT_draw_range_elements, GL_EXT_fog_coord,
    GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample,
    GL_EXT_framebuffer_object, GL_EXT_framebuffer_sRGB,
    GL_EXT_gpu_program_parameters, GL_EXT_gpu_shader4,
    GL_EXT_multi_draw_arrays, GL_EXT_packed_depth_stencil,
    GL_EXT_packed_float, GL_EXT_packed_pixels, GL_EXT_point_parameters,
    GL_EXT_rescale_normal, GL_EXT_secondary_color,
    GL_EXT_separate_specular_color, GL_EXT_shadow_funcs, GL_EXT_stencil_wrap,
    GL_EXT_subtexture, GL_EXT_texgen_reflection, GL_EXT_texture3D,
    GL_EXT_texture_array, GL_EXT_texture_buffer_object,
    GL_EXT_texture_compression_latc, GL_EXT_texture_compression_rgtc,
    GL_EXT_texture_compression_s3tc, GL_EXT_texture_cube_map,
    GL_EXT_texture_edge_clamp, GL_EXT_texture_env_add,
    GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3,
    GL_EXT_texture_filter_anisotropic, GL_EXT_texture_integer,
    GL_EXT_texture_lod_bias, GL_EXT_texture_mirror_clamp,
    GL_EXT_texture_object, GL_EXT_texture_rectangle, GL_EXT_texture_sRGB,
    GL_EXT_texture_shared_exponent, GL_EXT_texture_swizzle,
    GL_EXT_transform_feedback, GL_EXT_vertex_array, GL_KTX_buffer_region,
    GL_NV_blend_square, GL_NV_conditional_render, GL_NV_copy_depth_to_color,
    GL_NV_texgen_reflection, GL_SGIS_generate_mipmap,
    GL_SGIS_texture_edge_clamp, GL_SGIS_texture_lod, GL_WIN_swap_hint,
    WGL_EXT_swap_control

   visual  x  bf lv rg d st colorbuffer ax dp st accumbuffer  ms  cav
 id dep cl sp sz l  ci b ro  r  g  b  a bf th cl  r  g  b  a ns b eat
----------------------------------------------------------------------
0x23 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x24 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x25 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x26 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x27 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0x28 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0x29 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  0  0  0  0  0  0 0 None
0x2a 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  0  0  0  0  0  0 0 None
0x2b 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x2c 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x2d 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x2e 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x2f 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  2 1 None
0x30 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  8  0  0  0  0  2 1 None
0x31 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  0  0  0  0  0  2 1 None
0x32 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  0  0  0  0  0  2 1 None
0x33 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x34 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x35 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x36 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x37 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  4 1 None
0x38 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  8  0  0  0  0  4 1 None
0x39 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  0  0  0  0  0  4 1 None
0x3a 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  0  0  0  0  0  4 1 None
0x3b 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x3c 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x3d 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x3e 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x3f 24 tc  1  0  0 c  .  .  0  0  0  0  0  0  0  0  0  0  0  0 0 None
0x40 24 tc  1  0  0 c  .  .  0  0  0  0  0  0  0  0  0  0  0  0 0 None
0x41 24 tc  1  0  0 c  .  .  0  0  0  0  0  0  0  0  0  0  0  0 0 None
0x42 24 tc  1  0  0 c  .  .  0  0  0  0  0  0  0  0  0  0  0  0 0 None
0x43 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x44 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x45 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x46 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x47 24 tc  1  0  0 c  .  .  0  0  0  0  0  0  0  0  0  0  0  0 0 None
0x48 24 tc  1  0  0 c  .  .  0  0  0  0  0  0  0  0  0  0  0  0 0 None
0x49 24 tc  1  0  0 c  .  .  0  0  0  0  0  0  0  0  0  0  0  0 0 None
0x4a 24 tc  1  0  0 c  .  .  0  0  0  0  0  0  0  0  0  0  0  0 0 None
0x4b 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x4c 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x4d 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x4e 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x4f 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0x50 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0x51 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  0  0  0  0  0  0 0 None
0x52 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  0  0  0  0  0  0 0 None
0x53 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x54 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x55 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x56 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x57 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  2 1 None
0x58 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  8  0  0  0  0  2 1 None
0x59 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  0  0  0  0  0  2 1 None
0x5a 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  0  0  0  0  0  2 1 None
0x5b 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x5c 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x5d 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x5e 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x5f 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  4 1 None
0x60 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  8  0  0  0  0  4 1 None
0x61 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  0  0  0  0  0  4 1 None
0x62 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  0  0  0  0  0  4 1 None
0x63 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x64 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x65 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x66 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x67 24 dc  1  0  0 c  .  .  0  0  0  0  0  0  0  0  0  0  0  0 0 None
0x68 24 dc  1  0  0 c  .  .  0  0  0  0  0  0  0  0  0  0  0  0 0 None
0x69 24 dc  1  0  0 c  .  .  0  0  0  0  0  0  0  0  0  0  0  0 0 None
0x6a 24 dc  1  0  0 c  .  .  0  0  0  0  0  0  0  0  0  0  0  0 0 None
0x6b 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x6c 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  8 16 16 16 16  0 0 None
0x6d 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x6e 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  0 16 16 16 16  0 0 None
0x6f 24 dc  1  0  0 c  .  .  0  0  0  0  0  0  0  0  0  0  0  0 0 None
0x70 24 dc  1  0  0 c  .  .  0  0  0  0  0  0  0  0  0  0  0  0 0 None
0x71 24 dc  1  0  0 c  .  .  0  0  0  0  0  0  0  0  0  0  0  0 0 None
0x72 24 dc  1  0  0 c  .  .  0  0  0  0  0  0  0  0  0  0  0  0 0 None
0xad 32 tc  0 32  0 r  .  .  8  8  8  8  0  0  0  0  0  0  0  4 1 Ncon
Program output:

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: yes
   - 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: yes
   - VTC: no
 * Scissor Rectangle: yes
 * Hardware Occlusion Query: yes
 * User clip planes: yes
 * VET_UBYTE4 vertex element type: yes
 * Infinite far plane projection: yes
 * Hardware render-to-texture: yes
 * Floating point textures: yes
 * Non-power-of-two textures: yes
 * Volume textures: yes
 * Multiple Render Targets: 8
 * Point Sprites: yes
 * Extended point parameters: yes
 * Max Point Size: 8192
 * Vertex texture fetch: yes
   - Max vertex textures: 16
   - Vertex textures shared: yes

...

Parsing script glow.material
GLSL compiled : glow_ps_glslFragment shader was successfully compiled to run on hardware.
Cannot compile GLSL high-level shader : glow_vs_glsl Vertex shader failed to compile with the following errors:
ERROR: 1:6: 'normal' : undeclared identifier
ERROR: 1:6: ';' : syntax error parse error
ERROR:  compilation errors.  No code generated.

High-level program glow_vs_glsl encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Cannot compile GLSL high-level shader : glow_vs_glsl Cannot compile GLSL high-level shader : glow_vs_glsl Vertex shader failed to compile with the following errors:
ERROR: 1:6: 'normal' : undeclared identifier
ERROR: 1:6: ';' : syntax error parse error
ERROR:  compilation errors.  No code generated.
 in GLSLProgram::loadFromSource at OgreGLSLExtSupport.cpp (line 62)

...

WARNING: material glow has no supportable Techniques and will be blank. Explanation:
Pass 0: Vertex program glow_vs_glsl cannot be used - compile error.

WARNING: material alpha_glow has no supportable Techniques and will be blank. Explanation:
Pass 0: Vertex program glow_vs_glsl cannot be used - compile error.

WARNING: material no_depth_check_glow has no supportable Techniques and will be blank. Explanation:
Pass 0: Vertex program glow_vs_glsl cannot be used - compile error.
As you can see, it doesnt work either. This time its a compiler error. Note that only one of the two scripts fails to compile. Perhaps the reason is again, that arbvp1/arbfp1 is not enough. But then I ask myself: What sort of hardware quality is required here? I dont want to make a program, that relies on high-end hardware. That's something commercial games can afford.

edit: I substituted the cg/glow material by just glow to get this result. If i use the cg/ versions, I get just a not supported message.
0 x

User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US

Re: Stencil Glow Demo

Post by xavier » Mon Oct 26, 2009 4:56 pm

I'm afraid you are going to find that ATI's linux support is the absolute worst of the Big 3, by a large margin.

Realize that the shader is written in Cg -- nVidia supports their cards features in GL using vendor-specific GL extension strings and profiles like "vp40"; they aren't going to go out of their way to support whatever ATI has in their GL driver. It's known that all you'll get when running Cg shaders on ATI cards, is arb[vp|fp]1. This isn't an issue in Windows, where the ATI drivers explicitly support all of the D3D targets (vs_2_0, etc) so a compatible D3D target can be found for whatever profile is required by the shader.

In other words, if this demo really is that important to you, you will need (as I've already mentioned) to rewrite the shader in GLSL.
0 x
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.

Lastmerlin
Halfling
Posts: 74
Joined: Sun Nov 11, 2007 4:43 pm

Re: Stencil Glow Demo

Post by Lastmerlin » Mon Oct 26, 2009 5:49 pm

Ok, so no use of cg scripts.

There is a glsl version of the shader included in the demo. The first of these scripts compiles with success, the second one gives the compile error:

Code: Select all

Cannot compile GLSL high-level shader : glow_vs_glsl Vertex shader failed to compile with the following errors:
ERROR: 1:6: 'normal' : undeclared identifier
ERROR: 1:6: ';' : syntax error parse error
ERROR:  compilation errors.  No code generated.
A more extensive output is in the previous post.

Another question: If the supported version of fragment/vertex programs depends on the language used - how could Ogre give a general printout of the maximal fragment/vertex program version ?

About the importance of the demo: Of course I dont need this demo only. What I want is some highlighting of entities. But if I cant get this demo running its quite improbable, that I will get my highlighting done using a similar technique ;)
0 x

User avatar
calsmurf2904
Orc
Posts: 401
Joined: Tue Sep 16, 2008 9:39 pm
Location: Netherlands

Re: Stencil Glow Demo

Post by calsmurf2904 » Mon Oct 26, 2009 5:51 pm

Lastmerlin wrote:offtopic: I tried ubuntu 9.04 a few weeks ago. Result was a disaster. Just google for {ubuntu 9.04 intel} and you will discover that their new driver is completely screwed. I am waiting for 9.10 now.
offtopic: its not much better on windows vista + either :/ (Using windows 7 here)
0 x
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)
Image

User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US

Re: Stencil Glow Demo

Post by xavier » Mon Oct 26, 2009 5:56 pm

Lastmerlin wrote:Ok, so no use of cg scripts.

There is a glsl version of the shader included in the demo. The first of these scripts compiles with success, the second one gives the compile error:

Code: Select all

Cannot compile GLSL high-level shader : glow_vs_glsl Vertex shader failed to compile with the following errors:
ERROR: 1:6: 'normal' : undeclared identifier
ERROR: 1:6: ';' : syntax error parse error
ERROR:  compilation errors.  No code generated.
A more extensive output is in the previous post.
Well, you can feel free to fix it if you like -- I would guess that Assaf didn't pay much attention to the GLSL shader and was probably focusing on the Cg shader.
Another question: If the supported version of fragment/vertex programs depends on the language used - how could Ogre give a general printout of the maximal fragment/vertex program version ?
It does that explicitly -- you saw that in the log. There is nothing in OpenGL above arb[vp|fp]1 right now.
0 x
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.

Lastmerlin
Halfling
Posts: 74
Joined: Sun Nov 11, 2007 4:43 pm

Re: Stencil Glow Demo

Post by Lastmerlin » Mon Oct 26, 2009 9:46 pm

Got it fixed (halleluja, never wrote a shader or gsls before ^^ ) !


vs_glow.glsl

Code: Select all

uniform float size_value;
uniform float time;
varying vec3 normal;

void main(void)
{
   normal = gl_NormalMatrix * gl_Normal;
   vec3 Pos = gl_Vertex.xyz +  (size_value * (1.0 + (sin(time * 5.0) + 1.0)  / 15.0 ) * normal );

   gl_Position = gl_ModelViewProjectionMatrix * vec4(Pos,1.0)   ;

  
}
You might consider changing the files in the demo as well.

Thanks for your help and patience (especially xavier)
0 x

Ident
Gremlin
Posts: 155
Joined: Thu Sep 17, 2009 8:43 pm
Location: Austria
Contact:

Re:

Post by Ident » Thu Dec 03, 2009 3:08 pm

Assaf Raman wrote:@Shion:
change line 32:
to
#define LAST_STENCIL_OP_RENDER_QUEUE RENDER_QUEUE_OUTLINE_GLOW_GLOWS
with this line changed i had exactly what i wanted - a nice outside glow for my objects, thx a lot!
0 x

Sajyd
Gnoblar
Posts: 12
Joined: Wed Nov 25, 2009 5:08 pm

Re: Stencil Glow Demo

Post by Sajyd » Wed Dec 09, 2009 3:52 pm

Hi all ! I have a problem when I want compil the source file :


In French :

Code: Select all

Project : error PRJ0019: Un outil a retourné un code d'erreur à partir de "Exécution d'un événement après génération..."
In "Google Translation" ^^ :

Code: Select all

Project: error PRJ0019: A tool returned an error code from "Performing a post-build event ..."
But what's strange is when I launch the executable, it's work fine !
Thx in advance for u're help
0 x

Ident
Gremlin
Posts: 155
Joined: Thu Sep 17, 2009 8:43 pm
Location: Austria
Contact:

Re: Stencil Glow Demo

Post by Ident » Thu Dec 10, 2009 4:31 pm

i think you opened the wrong project file


i think i had that problem too, there should be another project file with multiple projects displayed in it in VS, try to look in another folder for it, can't remember where it was, and i hope i m right about this
0 x

User avatar
Pyritie
Gnome
Posts: 363
Joined: Wed Feb 25, 2009 6:15 pm
Location: UK
Contact:

Re:

Post by Pyritie » Thu Feb 18, 2010 2:53 am

RichTufty wrote:I have now converted this to Mogre and C# ... !! I shall upload the code very soon if anyone is interested?... prob at the weekend!
dammit, three years late

because I kinda need this now but I don't think he's going to respond :U
0 x
I use Mogre, BulletSharp, LuaNetInterface, irrKlang, and Miyagi! | Ponykart (Showcase)
Image

User avatar
GantZ
Kobold
Posts: 33
Joined: Thu Jan 31, 2008 9:23 pm
Location: France

Re: Stencil Glow Demo

Post by GantZ » Thu Feb 18, 2010 9:18 am

@Pyritie

there is a thread on the mogre forum about the port of the source code : http://www.ogre3d.org/addonforums/viewt ... f=8&t=3987
0 x
mogre community irc channel at : irc://freenode/#mogre

Image

User avatar
Pyritie
Gnome
Posts: 363
Joined: Wed Feb 25, 2009 6:15 pm
Location: UK
Contact:

Re: Stencil Glow Demo

Post by Pyritie » Thu Feb 18, 2010 11:55 am

ooh yay
0 x
I use Mogre, BulletSharp, LuaNetInterface, irrKlang, and Miyagi! | Ponykart (Showcase)
Image

User avatar
Pyritie
Gnome
Posts: 363
Joined: Wed Feb 25, 2009 6:15 pm
Location: UK
Contact:

Re: Stencil Glow Demo

Post by Pyritie » Thu Feb 18, 2010 9:13 pm

What would I do if I want to be able to change the colors easily so I'd still just use this one but, say, pass the colors through the material?

I'm using this for cytoplasm for my cells :D

EDIT: Also is it possible to have a glow around a glow? I want a glow for the cytoplasm but then also a glow around that for the cell membrane.
0 x
I use Mogre, BulletSharp, LuaNetInterface, irrKlang, and Miyagi! | Ponykart (Showcase)
Image

User avatar
Pyritie
Gnome
Posts: 363
Joined: Wed Feb 25, 2009 6:15 pm
Location: UK
Contact:

Re: Stencil Glow Demo

Post by Pyritie » Sun Feb 21, 2010 5:36 pm

0 x
I use Mogre, BulletSharp, LuaNetInterface, irrKlang, and Miyagi! | Ponykart (Showcase)
Image

carel
Gnoblar
Posts: 1
Joined: Mon Apr 05, 2010 10:44 am

Re: Stencil Glow Demo

Post by carel » Mon Apr 05, 2010 10:52 am

I ported this to Python-Ogre:
http://bitbucket.org/carel/durune-dev/w ... ines_Edges

Here's a screenshot: Image which is also at the link provided.

I still have a couple of questions though: This method requires two entities per model on the screen, isn't there a more efficient way of doing this using a shader and only one entity per model? Since I am a total newbie to Ogre and PythonOgre I don't really know where to start looking, all I want is to get a black outline around my 3D objects. Is this the best way to do this? If not, what should I look at?
0 x

broli
Halfling
Posts: 48
Joined: Fri Mar 31, 2006 5:08 pm

Re: Stencil Glow Demo

Post by broli » Mon Apr 05, 2010 2:54 pm

carel wrote: all I want is to get a black outline around my 3D objects. Is this the best way to do this? If not, what should I look at?
It's best to use a two pass material. First pass renders your model normally. The second pass you invert the cull mode and using a vertex shader you control the expansion.
0 x

User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
Contact:

Re: urmmmm

Post by KungFooMasta » Wed Apr 07, 2010 7:20 pm

Nakiks wrote:or just duplicate the mesh rescale & use another material with scene_blend add for the first head result and for the second just flip normals. Oldest trick in the book, way before shaders
How can I flip the normals? Is this something done on the material level, or the Entity level, or sub mesh level?

[Edit]

I think this would be done int he pass, using the cull_hardware or cull_software keywords, right? Which is better to use in this situation?

[/Edit]

[Edit2]

nm, manual says hardware is better for my case. If anybody is interested, this is all you need:

Code: Select all

material highlight
{
	technique
	{
		pass
		{
			ambient 1.0 0.0 0.0 1.0
			cull_hardware anticlockwise
		}
	}
}
Transparency doesn't work on the ambient coloring, but I probably need a TextureUnitState or something.

[/Edit2]
0 x
Creator of QuickGUI!

syndicatedragon
Kobold
Posts: 26
Joined: Thu Jun 21, 2007 4:16 am

Re: Stencil Glow Demo

Post by syndicatedragon » Tue Nov 23, 2010 1:17 am

broli wrote:
carel wrote: all I want is to get a black outline around my 3D objects. Is this the best way to do this? If not, what should I look at?
It's best to use a two pass material. First pass renders your model normally. The second pass you invert the cull mode and using a vertex shader you control the expansion.
Does anyone know of an example of this technique?
0 x

User avatar
hebdemnobad
Goblin
Posts: 274
Joined: Wed Feb 09, 2005 5:09 pm
Location: catskill escarpment, new york, usa
Contact:

Re: Stencil Glow Demo

Post by hebdemnobad » Fri Apr 15, 2011 7:17 pm

colleagues:

what edits would i have to do the .cg files to prevent this very cool glow effect from oscillating over time?

thanks for your $.02

-hebdemnobad
0 x

User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4291
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 2
Contact:

Re: Stencil Glow Demo

Post by spacegaier » Fri Apr 15, 2011 7:47 pm

Well curently the the sinus(time) manipulates the appearance. So get rid of that and you should be good to go :) .
0 x
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...

User avatar
hebdemnobad
Goblin
Posts: 274
Joined: Wed Feb 09, 2005 5:09 pm
Location: catskill escarpment, new york, usa
Contact:

Re: Stencil Glow Demo

Post by hebdemnobad » Fri Apr 15, 2011 8:32 pm

spacegaier wrote:Well curently the the sinus(time) manipulates the appearance. So get rid of that and you should be good to go :) .
thanks! i did a bit of deleting of the sin statement and replaced it with a good old integer. now i have a good cheap glow that doesn't act nutty when it's in front of or back of other objects.
0 x

shenjoku
Gremlin
Posts: 193
Joined: Sat Aug 06, 2011 11:02 pm

Re: Stencil Glow Demo

Post by shenjoku » Fri Aug 19, 2011 10:27 pm

Is there any way to use this easily on an animated mesh? The only way I could see this working is if you somehow synced up the animation of the glow entity with the main entity as well, which seems like a pain.

I'd also like this to be seen when occluded by other entities. So like when the player walks behind a building it'll show a glow outline on top of everything so you can still see where you are. I tried moving the glow rendering to the highest possible rendering queue but that didn't work and I'm not sure what else to do. Suggestions?

EDIT: Found the solution to my first problem. To make the glow animate with it's parent just call glowEntity->shareSkeletonInstanceWith(entity);. Now I just need to figure out how to make the glow render on top of everything...

EDIT2: Got it working so it shows behind stuff but then I realized it's not really an outline so I'm not sure if I can use this or not...I guess It's a good starting point.
0 x

Post Reply