2 GOOD Feature Request ^^

What it says on the tin: a place to discuss proposed new features.
Post Reply
Mickael
Gnoblar
Posts: 13
Joined: Thu Jan 22, 2004 12:41 pm
Location: France,grenoble

2 GOOD Feature Request ^^

Post by Mickael »

Hello (i'm french ^^),
i have 2 feature requests for Ogre3D :

- Better FPS (frame per seconde) for shadows
- Soft Shadows

and next your engine will be the better free engine !!! :)

Thanks

Mickael
Mickael
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

The exsiting shadows implementations have an enormous amount of optimisations already in them. We do extensive culling checks, use hardware acceleration as much as possible, and use all the tricks you'll find in all the tech documents on the web for stencil shadows.

If you need them to be faster, be more sensible with poly count, number of lights and prefer modulative over additive (for stencil shadows) or texture size for texture based shadows. Shadows are inherently expensive and you need to balance them - there is no generic 'fast shadow' routine.

As for soft shadows, you can already do them with shaders and texture-based shadows (arguably the existing texture shadows are soft-ish). In the 1.0.0 release you can set up custom shaders for both the caster and receiver in order to do this - the receiver should use a filter. But this request is in direct competition with your first - making shadows softer is not going to make your shadows faster, quite the opposite.
Mickael
Gnoblar
Posts: 13
Joined: Thu Jan 22, 2004 12:41 pm
Location: France,grenoble

Post by Mickael »

the .fx in this link : http://www.gamedev.net/columns/hardcore/softedgeshadow/

work good in ogre3D 1.0 ?

edit : i precise i don't know shader language :/
Mickael
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

You can use this technique in 1.0, provided you write the shaders. The trouble is that when you use techniques like this they dictate the rest of your content pipeline since everything has to be shader-based. OGRE can do that, but it requires you to make that choice to go completely shader, it's not something that can just be 'switched on'.
Meddten
Halfling
Posts: 71
Joined: Mon Aug 09, 2004 8:28 pm
Location: Austria

Post by Meddten »

In the 1.0.0 release you can set up custom shaders for both the caster and receiver in order to do this - the receiver should use a filter.

So now I've a question:

The caster in this case is the light, right?
The receiver ist for example the floor, or all the other geometry in the scene.

Now my thoughts are or better my problem is, i know I can apply shader like normal mapping cell shading for instance through setMaterialName().

How can i implement soft shadows that they effect all the geometry, obviouslt not with setMaterialName().

Can you give me a hint, a littel code snippet, an explaination where to start and how?

Thanks in advance
Meddten
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

No, the caster is the object casting the shadow.

Look at the API docs for SceneManager::setShadowTextureCasterMaterial, SceneManager::setShadowTextureReceiverMaterial and SceneManager::setShadowTexturePixelFormat; you'll need the CVS version until the 1.0.0 final is done in a few days. The article quoted shows the technique - it's the same in Ogre except without all the D3D-specific cruft.

Soft shadows will be slower.
Meddten
Halfling
Posts: 71
Joined: Mon Aug 09, 2004 8:28 pm
Location: Austria

Post by Meddten »

Thanks!


Unfortunately setShadowTextureCasterMaterial and the other stuff does not exist in CVS
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Get the 'v1-0' branch.
Meddten
Halfling
Posts: 71
Joined: Mon Aug 09, 2004 8:28 pm
Location: Austria

Post by Meddten »

I thought I have that one, because I have CEGUIRenderer folder under Samples/Common, thats 1.0 branch isn't it

Checked out today in the morning

I definetley have 1.0 branch my version is 1.1.0 Dagon

Code: Select all

Find all "setShadowTexture", Subfolders, Find Results 1, Entire Solution, "*.c;*.cpp;*.cxx;*.cc;*.tli;*.tlh;*.h;*.hpp;*.hxx;*.hh;*.inl;*.rc;*.resx;*.idl;*.asm;*.inc"
E:\01_Projects\Ogre\ogrenew\OgreMain\src\OgreSceneManager.cpp(3498):void SceneManager::setShadowTextureSize(unsigned short size)
E:\01_Projects\Ogre\ogrenew\OgreMain\src\OgreSceneManager.cpp(3505):void SceneManager::setShadowTextureCount(unsigned short count)
E:\01_Projects\Ogre\ogrenew\OgreMain\src\OgreSceneManager.cpp(3512):void SceneManager::setShadowTextureSettings(unsigned short size, unsigned short count)
E:\01_Projects\Ogre\ogrenew\OgreMain\include\OgreSceneManager.h(1600):        virtual void setShadowTextureSize(unsigned short size);
E:\01_Projects\Ogre\ogrenew\OgreMain\include\OgreSceneManager.h(1610):        virtual void setShadowTextureCount(unsigned short count);
E:\01_Projects\Ogre\ogrenew\OgreMain\include\OgreSceneManager.h(1615):            @see setShadowTextureSize and setShadowTextureCount for details, this
E:\01_Projects\Ogre\ogrenew\OgreMain\include\OgreSceneManager.h(1619):        virtual void setShadowTextureSettings(unsigned short size, unsigned short count);
E:\01_Projects\Ogre\ogrenew\OgreMain\include\OgreSceneManager.h(1642):        virtual void setShadowTextureFadeStart(Real fadeStart) 
E:\01_Projects\Ogre\ogrenew\OgreMain\include\OgreSceneManager.h(1651):        virtual void setShadowTextureFadeEnd(Real fadeEnd) 
E:\01_Projects\Ogre\ogrenew\Samples\Shadows\src\Shadows.cpp(432):            mSceneMgr->setShadowTextureSettings(1024, 2);
E:\01_Projects\Ogre\ogrenew\Samples\Shadows\src\Shadows.cpp(437):            mSceneMgr->setShadowTextureSettings(512, 2);
Total found: 11    Matching files: 3    Total files searched: 679
User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

Post by DWORD »

Dunno, but maybe you have to check out specifically the 'v1-0' or 'Azathoth' branch, as sinbad says. All changes to Azathoth does not necessarily exist in Dagon (yet).
Slougi
Kobold
Posts: 34
Joined: Thu Dec 30, 2004 2:12 am
Contact:

Post by Slougi »

sinbad wrote:You can use this technique in 1.0, provided you write the shaders. The trouble is that when you use techniques like this they dictate the rest of your content pipeline since everything has to be shader-based. OGRE can do that, but it requires you to make that choice to go completely shader, it's not something that can just be 'switched on'.
Hi Sinbad,
I'm still pretty new to 3d stuff and Ogre in particular and don't really understand the above statement regarding shaders. Any chance you could elaborate on that and/or point me to some additional info?
Thanks :)
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

There is plenty of information in the link Mickael posted above. If you're new to this and that doesn't make any sense, you should probably start a little simpler - soft shadows are pretty high up the chain of complex effects.
Slougi
Kobold
Posts: 34
Joined: Thu Dec 30, 2004 2:12 am
Contact:

Post by Slougi »

Right sorry, originally just clicked on the link to check out how the shadow looked :) Shall read through it.
Post Reply