3

In Ogre, i'm projecting a decal onto a sphere. However, the decal shines straight through the sphere and projects another decal onto the opposite side! How do I stop that?

material planets/Planet_Earth { 
  technique { 
    pass { 
      texture_unit { 
        texture earth_surface.png 
        filtering trilinear 
        scale 1 1 
      } 
    } 
  } 
} 

I'm afraid neither of the below answers are working. I have tried every shadow setting ald explored blender's texture settings, but nothing seems to work. The decal just renders both sides! It even happens in Ogre Tutorial 6! Any possible suggestion appreciated!

Note: I'm editing someone elses code, and just discovered that it's not a mesh, the sphere is being created in the code :O sowwy :(

Magicaxis
  • 371
  • 7
  • 16
  • 1
    Can you provide the material script and a screenshot of what you see? – Alessandro Pezzato Jun 28 '12 at 13:51
  • Sure :3 the material is: material planets/Planet_Earth { technique { pass { texture_unit { // texture earth.jpg // texture earthmap1k.jpg texture earth_surface.png filtering trilinear scale 1 1 } } } } I'm not allowed to post a pic though – Magicaxis Jun 29 '12 at 04:48
  • You can edit your question adding more info, do not use comment for this. If you cannot post a picture, you can upload it somewhere (imageshack, dropbox...) and provide a link. – Alessandro Pezzato Jun 29 '12 at 07:51
  • Is the "sphere" a mesh or a PT_SPHERE? Look at [this blender tutorial](http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/UV_Map_Basics), it explains how uvmap works. – Alessandro Pezzato Jun 29 '12 at 07:56
  • Thanks :) It's a mesh :) Lol sorry, "not allowed", i meant the company I am working for won't allow me to post a picture – Magicaxis Jun 29 '12 at 08:26
  • Maybe this one will help you: [OGRE Forum - Projective decals (without the back-projected second decal)](http://www.ogre3d.org/forums/viewtopic.php?p=123116) – kolenda Aug 02 '12 at 15:55

3 Answers3

1

Enabling some form of shadows should fix it. Ogre Basic Shadows

carpat
  • 861
  • 10
  • 25
1

You have to use a texture that fit your mesh. Ogre uses UV mapping to map decals to meshes. Depending on what CG program you are using to create your 3d model, there are different ways to create it. Look at this blender tutorial for an example. You need also an exporter to get a .mesh file out of it.

Alessandro Pezzato
  • 8,603
  • 5
  • 45
  • 63
-1

I just couldn't get it to work, as there is no uv map. I gave up and used a .mesh that looked like my decal and positioned it on the surface of the sphere instead. Sorry guys.

Magicaxis
  • 371
  • 7
  • 16