CgFx support in OGRE
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
Can you have a go fixing it yourself and giving back a patch?
Watch out for my OGRE related tweets here.
- SunSailor
- Gnoll
- Posts: 699
- Joined: Sun Jan 02, 2005 5:45 pm
- Location: Velbert, Germany
- x 2
- Contact:
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
I just compiled with CodeBlocks and gcc with no problem on windows.
I am not going to create the environment needed to solve this issue – sorry.
This is an issue that can be solved quickly if someone with the same compile environment as you will try to solve it.
So – you can try to solve it yourself or wait for this someone to have the time to do it.
Another option for you is to remove CgFxScriptLoader and the reference for it from the project.
I am not going to create the environment needed to solve this issue – sorry.
This is an issue that can be solved quickly if someone with the same compile environment as you will try to solve it.
So – you can try to solve it yourself or wait for this someone to have the time to do it.
Another option for you is to remove CgFxScriptLoader and the reference for it from the project.
Watch out for my OGRE related tweets here.
- SunSailor
- Gnoll
- Posts: 699
- Joined: Sun Jan 02, 2005 5:45 pm
- Location: Velbert, Germany
- x 2
- Contact:
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
After thinking more about the last post I decided to clear out a few things that are perhaps not as obvious as I was thinking.
First – the head can sometimes be broken – it is the active development branch – and is broken because of it from time to time.
Secondly – The issue you described will be fixed by the time 1.8 will come out or broken code will be removed but in no case we will release an official broken version.
When you want to work with the latest code – you take the chance that some new features are not fully developed.
First – the head can sometimes be broken – it is the active development branch – and is broken because of it from time to time.
Secondly – The issue you described will be fixed by the time 1.8 will come out or broken code will be removed but in no case we will release an official broken version.
When you want to work with the latest code – you take the chance that some new features are not fully developed.
Watch out for my OGRE related tweets here.
-
- OGRE Retired Team Member
- Posts: 2903
- Joined: Thu Jan 18, 2007 2:48 pm
- x 58
- Contact:
I just took a quick look, the problem is that in the OgreCgFxScriptLoader.h the enum GpuProgramType is unknown (and probably a bunch of other stuff). All those nasty error lines go away if you simply add
to the file. I'll assume that header is automatically pulled in from somewhere under Windows...
Code: Select all
#include "OgreGpuProgram.h"
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
Thanks CABAListic.
I have committed this fix. Anyone that had the compile issue on linux can update and retry to compile.
I have committed this fix. Anyone that had the compile issue on linux can update and retry to compile.
Watch out for my OGRE related tweets here.
- SunSailor
- Gnoll
- Posts: 699
- Joined: Sun Jan 02, 2005 5:45 pm
- Location: Velbert, Germany
- x 2
- Contact:
Shure, HEAD is the development version, that this can be broken is not the deal. If someone offers his help, because he has a setup, where the bug is reproduceable, he should be taken serious and one should take this offer, at least, that is how it is handled here in my company. We are always happy, if one of our users serves the solution on a plate of silver, we don't put them down with blames and ignorance.
And thanks, CABAListic, I already found that out, too, but didn't react, as help doesn't seem to be very welcome here.
And thanks, CABAListic, I already found that out, too, but didn't react, as help doesn't seem to be very welcome here.
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
@SunSailor: from what you wrote it seems that you got offended.
If that is the case I want to apologize – I never meant to insult you in any way.
You offered your help and I tried to ask you to go ahead and help – but from some reason (perhaps a language or other communication barrier) my point didn’t go through.
Let’s not continue on this issue – I will try to be more sensitive in the future.
If that is the case I want to apologize – I never meant to insult you in any way.
You offered your help and I tried to ask you to go ahead and help – but from some reason (perhaps a language or other communication barrier) my point didn’t go through.
Let’s not continue on this issue – I will try to be more sensitive in the future.
Watch out for my OGRE related tweets here.
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
lighting is still not done.
documentation is this thread for now.
documentation is this thread for now.
Watch out for my OGRE related tweets here.
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
I found out why most of the bump\normal maps cgfx from "mental mill (R) Artist Edition" didn’t work in OGRE, turns out that you need to have tangent and binormal as part of the vertex buffer for the model to work.
After I added them – the cgfx files look like they should.
Here are sample screenshots (with no ambient light):
I added tangent and binormal to my sample model and to the ogre head model.
Here is the ogre head with tangent and binormal.
Here is the cgfx test model with tangent and binormal.
I also fixed a small endless loop bug – so get the latest code from the SVN.
After I added them – the cgfx files look like they should.
Here are sample screenshots (with no ambient light):
I added tangent and binormal to my sample model and to the ogre head model.
Here is the ogre head with tangent and binormal.
Here is the cgfx test model with tangent and binormal.
I also fixed a small endless loop bug – so get the latest code from the SVN.
Watch out for my OGRE related tweets here.
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
OGRE can create the tangents for you for an existing mesh using code like this (used in many samples):
I used my own code because I wanted also the binormal, perhaps I wasted my time writing it, but here it is if anyone ever wants it:
void addTangentAndBinormalToMeshByNormal( String meshName )
Code: Select all
MeshPtr m = MeshManager::getSingleton().load("ogrehead.mesh",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
unsigned short src, dest;
if (!m->suggestTangentVectorBuildParams(VES_TANGENT, src, dest))
{
m->buildTangentVectors(VES_TANGENT, src, dest);
}
void addTangentAndBinormalToMeshByNormal( String meshName )
Watch out for my OGRE related tweets here.
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
I added all the light support I can with the existing shader constant types.
Code is in the SVN.
The following code (red directional light from above):
Gets me the following screenshot:
Code is in the SVN.
The following code (red directional light from above):
Code: Select all
mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
Vector3 dir(-1, -1, 0.5);
dir.normalise();
Light* l = mSceneMgr->createLight("light1");
l->setDiffuseColour(ColourValue::Red);
l->setSpecularColour(ColourValue::Red);
l->setType(Light::LT_DIRECTIONAL);
l->setDirection(dir);
Watch out for my OGRE related tweets here.
-
- Hobgoblin
- Posts: 540
- Joined: Wed Nov 17, 2004 4:36 pm
- Location: Middlesbrough, England
I'm getting the following error when loading the cg_ProgramManager plugin:
I'm trying to use this with 1.6.0 should that be okay, any idea what the problem might be?
Code: Select all
10:13:03: OGRE EXCEPTION(7:InternalErrorException): Unable to Set create State: CG ERROR : The parameter used is invalid. in CgFxScriptLoader::CgStateListener::init at ..\src\OgreCgProgramManagerDll.cpp (line 66)
Regards,
Sticky.
Web: http://sourceforge.net/projects/ogreoggsound/
SVN: https://ogreoggsound.svn.sourceforge.ne ... ound/trunk
Sticky.
Web: http://sourceforge.net/projects/ogreoggsound/
SVN: https://ogreoggsound.svn.sourceforge.ne ... ound/trunk
- syedhs
- Silver Sponsor
- Posts: 2703
- Joined: Mon Aug 29, 2005 3:24 pm
- Location: Kuala Lumpur, Malaysia
- x 51
I think that should be okay, as the changes are only done within CG plugin - I am doing it myself. You will have to copy over OgreString.cpp/.h though, as there is an additional member function for StringUtil which is used by new CG plugin.Stickymango wrote: I'm trying to use this with 1.6.0 should that be okay, any idea what the problem might be?
A willow deeply scarred, somebody's broken heart
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
You are using the latest 1-6 code from the SVN and getting this error?Stickymango wrote:I'm getting the following error when loading the cg_ProgramManager plugin:I'm trying to use this with 1.6.0 should that be okay, any idea what the problem might be?Code: Select all
10:13:03: OGRE EXCEPTION(7:InternalErrorException): Unable to Set create State: CG ERROR : The parameter used is invalid. in CgFxScriptLoader::CgStateListener::init at ..\src\OgreCgProgramManagerDll.cpp (line 66)
(This is unrelated to this thread, right? but I do want to help you...)
[EDIT1] I see some problems there(1-6), I will try to fix and update the SVN later, I will post when I done that. [/EDIT1]
[EDIT2] No - the problem in 1-6 were releated to the ParticleGS when you run dx9, can you explain how I can create the same problem you have on my computer? [/EDIT2]
Watch out for my OGRE related tweets here.
-
- Hobgoblin
- Posts: 540
- Joined: Wed Nov 17, 2004 4:36 pm
- Location: Middlesbrough, England
What I did was download svn version into new folder, copied cgpluginmanager folder into my stable 1.6.0 folder, built the plugin then copied the dll to my application folder and ran...
Regards,
Sticky.
Web: http://sourceforge.net/projects/ogreoggsound/
SVN: https://ogreoggsound.svn.sourceforge.ne ... ound/trunk
Sticky.
Web: http://sourceforge.net/projects/ogreoggsound/
SVN: https://ogreoggsound.svn.sourceforge.ne ... ound/trunk
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
Do you get the same problem also in the OGRE samples there?
Watch out for my OGRE related tweets here.
-
- Hobgoblin
- Posts: 540
- Joined: Wed Nov 17, 2004 4:36 pm
- Location: Middlesbrough, England
Yes. I tried copying the updated OgreString files and rebuilding OgreMain and still the same
Regards,
Sticky.
Web: http://sourceforge.net/projects/ogreoggsound/
SVN: https://ogreoggsound.svn.sourceforge.ne ... ound/trunk
Sticky.
Web: http://sourceforge.net/projects/ogreoggsound/
SVN: https://ogreoggsound.svn.sourceforge.ne ... ound/trunk
-
- Hobgoblin
- Posts: 540
- Joined: Wed Nov 17, 2004 4:36 pm
- Location: Middlesbrough, England
Found out what the problem was, I had an old version of the cg.dll from OGRE 1.2/4, I downloaded the latest cg toolkit and it now works fine
Regards,
Sticky.
Web: http://sourceforge.net/projects/ogreoggsound/
SVN: https://ogreoggsound.svn.sourceforge.ne ... ound/trunk
Sticky.
Web: http://sourceforge.net/projects/ogreoggsound/
SVN: https://ogreoggsound.svn.sourceforge.ne ... ound/trunk
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
I am happy that it works for you.
If find any problem or create nice shaders that you want to share with us post them here.
If find any problem or create nice shaders that you want to share with us post them here.
Watch out for my OGRE related tweets here.
-
- Gnoblar
- Posts: 13
- Joined: Tue Jul 29, 2008 2:59 pm
- x 1
Ogre 1.6 support
Hey, I just wanted to let you know that when building the current svn against 1.6 it complains about not having stringutil::replace all, I'm only using 2.0 and not 2.1 so I commented out line 170 of OgreCgProgram.cpp. We could probably just put a helper function in there to do the same thing to maintain 1.6 compatibility and usage with cg 2.1. What do you think?
EDIT - looks like this was already noted above, sorry for the repeat
EDIT - looks like this was already noted above, sorry for the repeat