Page 3 of 6

Posted: Fri Sep 26, 2008 11:37 am
by Assaf Raman
Can you have a go fixing it yourself and giving back a patch?

Posted: Fri Sep 26, 2008 12:57 pm
by SunSailor
Hardly, I can have a look at it, but as I'm absolutely not in that topic, I can't guarrantee you anything.
Edit: What I can tell from here is, that GpuProgramType isn't defined at that point, can it be, that there is a header file included in platform dependent parts only?

Posted: Fri Sep 26, 2008 1:12 pm
by Assaf Raman
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.

Posted: Fri Sep 26, 2008 1:19 pm
by SunSailor
Ok, leave HEAD broken, not my project... But don't say, I didn't offer my help.

Posted: Fri Sep 26, 2008 1:29 pm
by Assaf Raman
Thanks for the notice and help.

Posted: Fri Sep 26, 2008 1:52 pm
by Assaf Raman
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.

Posted: Fri Sep 26, 2008 1:58 pm
by CABAListic
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

Code: Select all

#include "OgreGpuProgram.h"
to the file. I'll assume that header is automatically pulled in from somewhere under Windows...

Posted: Fri Sep 26, 2008 2:05 pm
by Assaf Raman
Thanks CABAListic.

I have committed this fix. Anyone that had the compile issue on linux can update and retry to compile.

Posted: Fri Sep 26, 2008 2:07 pm
by SunSailor
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.

Posted: Fri Sep 26, 2008 2:31 pm
by Assaf Raman
@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.

Posted: Mon Sep 29, 2008 3:20 pm
by xadhoom
Hi!

How is the status of this importer regarding lighting and pass issues?
Is there also some kind of documentation available?

Thanks for sharing!

Posted: Mon Sep 29, 2008 3:49 pm
by Assaf Raman
lighting is still not done.
documentation is this thread for now.

Posted: Mon Oct 06, 2008 9:08 pm
by Assaf Raman
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):
Image
Image

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.

Posted: Tue Oct 07, 2008 12:35 pm
by Assaf Raman
OGRE can create the tangents for you for an existing mesh using code like this (used in many samples):

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);
		} 
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 )

Posted: Wed Oct 08, 2008 12:04 am
by Assaf Raman
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):

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);
Gets me the following screenshot:
Image

Posted: Wed Oct 08, 2008 10:18 am
by Stickymango
I'm getting the following error when loading the cg_ProgramManager plugin:

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)
I'm trying to use this with 1.6.0 should that be okay, any idea what the problem might be?

Posted: Wed Oct 08, 2008 10:37 am
by Brocan
Great, i will checkout the svn, compile and try this night :D

Posted: Wed Oct 08, 2008 11:55 am
by syedhs
Stickymango wrote: I'm trying to use this with 1.6.0 should that be okay, any idea what the problem might be?
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.

Posted: Wed Oct 08, 2008 1:49 pm
by Assaf Raman
Stickymango wrote:I'm getting the following error when loading the cg_ProgramManager plugin:

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)
I'm trying to use this with 1.6.0 should that be okay, any idea what the problem might be?
You are using the latest 1-6 code from the SVN and getting this error?
(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]

Posted: Wed Oct 08, 2008 4:01 pm
by Stickymango
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...

Posted: Wed Oct 08, 2008 5:20 pm
by Assaf Raman
Do you get the same problem also in the OGRE samples there?

Posted: Wed Oct 08, 2008 5:41 pm
by Stickymango
Yes. I tried copying the updated OgreString files and rebuilding OgreMain and still the same :?

Posted: Thu Oct 09, 2008 9:47 pm
by Stickymango
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 :)

Posted: Thu Oct 09, 2008 10:06 pm
by Assaf Raman
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.

Ogre 1.6 support

Posted: Wed Oct 15, 2008 4:03 am
by ShadowFire
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