Waiting thenAssaf Raman wrote:This doesn't work yet.
I hope I will post something working soon.
I am almost there in getting some basic samples working.
CgFx support in OGRE
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
Got the basic to work, here is the glass demo from mental mill Artist Edition:
I just used the exported cgfx file from mental mill Artist Edition without any change to the cgfx file and without creating any new file.
I will post commit really soon.
I just used the exported cgfx file from mental mill Artist Edition without any change to the cgfx file and without creating any new file.
I will post commit really soon.
Watch out for my OGRE related tweets here.
- Wolfmanfx
- OGRE Team Member
- Posts: 1525
- Joined: Fri Feb 03, 2006 10:37 pm
- Location: Austria - Leoben
- x 99
- Contact:
-
- Ogre Magi
- Posts: 1266
- Joined: Tue Aug 12, 2003 1:53 am
- Location: Melbourne, Australia
- x 1
- Contact:
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
If you will post some cgfx shaders and the textures they need - I will be able to test them and make sure they work.
Watch out for my OGRE related tweets here.
- Brocan
- Orc
- Posts: 441
- Joined: Tue Aug 01, 2006 1:43 am
- Location: Spain!!
- x 8
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
That is fine. I will check the samples that come with it.
Watch out for my OGRE related tweets here.
- SiENcE
- Goblin
- Posts: 231
- Joined: Thu May 11, 2006 3:07 pm
- Location: Berlin
- Contact:
You can try the samples from the NVIDIA Shader Library - CgFX.
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
I just commited to 1.8 the CgFx script loader as part of the Cg program manager plugin.
This loader loads files with the extension cgfx from the OGRE resource pool and creates ogre material and cg programs as according to what exists in the cgfx file.
The name of the material that is created is similar to the name of the cgfx file - so for a file named "glass.cgfx" it will be "glass.cgfx".
I tested this code with exporting some of the samples that come with "mental mill (R) Artist Edition" (you get it free with FX Composer 2.5).
Most of the hard code is written - the main feature that is missing are:
1. All sort of pass state translations - like alpha blend and such.
2. More standard documentation.
3. Error logging and exception handling.
I really worked hard on this feature; I guess about 7 full days.
I will be really happy if the community will share nice cgfx shaders by posting the shaders and textures (and possibly the relevant source code).
This code is my gift to the community for the Jewish holyday season.
This loader loads files with the extension cgfx from the OGRE resource pool and creates ogre material and cg programs as according to what exists in the cgfx file.
The name of the material that is created is similar to the name of the cgfx file - so for a file named "glass.cgfx" it will be "glass.cgfx".
I tested this code with exporting some of the samples that come with "mental mill (R) Artist Edition" (you get it free with FX Composer 2.5).
Most of the hard code is written - the main feature that is missing are:
1. All sort of pass state translations - like alpha blend and such.
2. More standard documentation.
3. Error logging and exception handling.
I really worked hard on this feature; I guess about 7 full days.
I will be really happy if the community will share nice cgfx shaders by posting the shaders and textures (and possibly the relevant source code).
This code is my gift to the community for the Jewish holyday season.
Watch out for my OGRE related tweets here.
- Praetor
- OGRE Retired Team Member
- Posts: 3335
- Joined: Tue Jun 21, 2005 8:26 pm
- Location: Rochester, New York, US
- x 3
- Contact:
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
@Praetor: I created most of what it needed to convert cgfx states to ogre states - there are switch case statements for everything – and also “getValueâ€
Watch out for my OGRE related tweets here.
- syedhs
- Silver Sponsor
- Posts: 2703
- Joined: Mon Aug 29, 2005 3:24 pm
- Location: Kuala Lumpur, Malaysia
- x 51
- Praetor
- OGRE Retired Team Member
- Posts: 3335
- Joined: Tue Jun 21, 2005 8:26 pm
- Location: Rochester, New York, US
- x 3
- Contact:
- Brocan
- Orc
- Posts: 441
- Joined: Tue Aug 01, 2006 1:43 am
- Location: Spain!!
- x 8
I have a question, how are the lights mapped to ogre?
Because i have loaded the examples provided by MentalMill (I have just exported it to cgfx) but the examples that have a light, don't run well in ogre.
I have created a point light and nothing.
Paralax example of mental mill into ogre:
With a simple phong shader:
The phong shader
[EDIT by AssafRaman]I changed the long code quote to a file link - I don't allow such long code pastes in my threads, upload to google pages and give a link to such code[/EDIT]
Note: the ogrehead is where i have the point light
Because i have loaded the examples provided by MentalMill (I have just exported it to cgfx) but the examples that have a light, don't run well in ogre.
I have created a point light and nothing.
Paralax example of mental mill into ogre:
With a simple phong shader:
The phong shader
[EDIT by AssafRaman]I changed the long code quote to a file link - I don't allow such long code pastes in my threads, upload to google pages and give a link to such code[/EDIT]
Note: the ogrehead is where i have the point light
Last edited by Brocan on Wed Sep 24, 2008 2:59 pm, edited 2 times in total.
- Praetor
- OGRE Retired Team Member
- Posts: 3335
- Joined: Tue Jun 21, 2005 8:26 pm
- Location: Rochester, New York, US
- x 3
- Contact:
I've been looking at the mappings and implementing a few (without really testing these mappings yet...)
The lights I don't think can be mapped to Ogre in any way. Basically CgFx is stepping into the scene management arena with lights being bound to shaders.
In your parallax example, can you try manually creating an Ogre light in the scene? It's guaranteed that some options and settings in CgFx simply won't have natural mappings into Ogre.
The lights I don't think can be mapped to Ogre in any way. Basically CgFx is stepping into the scene management arena with lights being bound to shaders.
In your parallax example, can you try manually creating an Ogre light in the scene? It's guaranteed that some options and settings in CgFx simply won't have natural mappings into Ogre.
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
I know about this issue, I didn't have time to look at it yet.
Watch out for my OGRE related tweets here.
- Brocan
- Orc
- Posts: 441
- Joined: Tue Aug 01, 2006 1:43 am
- Location: Spain!!
- x 8
Yeah, i'm sure of that.Praetor wrote:The lights I don't think can be mapped to Ogre in any way. Basically CgFx is stepping into the scene management arena with lights being bound to shaders.
In my photos i have a ogre light point created where the ogrehead is.
Edit: Ah, ok Assaf, i thought that was a problem in my computer
Edit2: I don't remember googlepages to upload the code, sorry
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
- SunSailor
- Gnoll
- Posts: 699
- Joined: Sun Jan 02, 2005 5:45 pm
- Location: Velbert, Germany
- x 2
- Contact:
Btw., the last commit regarding this feature broke compilation under linux:
Maybe someone can fix this, as I don't feel very home in that region of OGRE .
Code: Select all
../../../PlugIns/CgProgramManager/include/OgreCgFxScriptLoader.h:1472: error: expected ‘,’ or ‘...’ before ‘ogreProgramType’
../../../PlugIns/CgProgramManager/include/OgreCgFxScriptLoader.h:1472: error: ISO C++ forbids declaration of ‘GpuProgramType’ with no type
../../../PlugIns/CgProgramManager/include/OgreCgFxScriptLoader.h:1473: error: ‘GpuProgramParametersSharedPtr’ has not been declared
../../../PlugIns/CgProgramManager/include/OgreCgFxScriptLoader.h:1474: error: ‘GpuProgramParametersSharedPtr’ has not been declared
../../../PlugIns/CgProgramManager/include/OgreCgFxScriptLoader.h:1477: error: ‘GpuProgramParametersSharedPtr’ has not been declared
../../../PlugIns/CgProgramManager/include/OgreCgFxScriptLoader.h:1478: error: ‘GpuProgramParametersSharedPtr’ has not been declared
../../../PlugIns/CgProgramManager/include/OgreCgFxScriptLoader.h:1479: error: ‘GpuProgramParametersSharedPtr’ has not been declared
../../../PlugIns/CgProgramManager/include/OgreCgFxScriptLoader.h:1480: error: ‘GpuProgramParameters’ has not been declared
../../../PlugIns/CgProgramManager/include/OgreCgFxScriptLoader.h:1480: error: expected ‘,’ or ‘...’ before ‘&’ token
OgreCgFxScriptLoader.cpp:2784: error: prototype for ‘void Ogre::CgFxScriptLoader::parseCgProgram(_CGpass*, Ogre::Pass*, Ogre::GpuProgramType)’ does not match any in class ‘Ogre::CgFxScriptLoader’
../../../PlugIns/CgProgramManager/include/OgreCgFxScriptLoader.h:1472: error: candidate is: void Ogre::CgFxScriptLoader::parseCgProgram(_CGpass*, Ogre::Pass*, int)
OgreCgFxScriptLoader.cpp:2881: error: prototype for ‘void Ogre::CgFxScriptLoader::parseCgProgramParameters(_CGpass*, Ogre::GpuProgramParametersSharedPtr)’ does not match any in class ‘Ogre::CgFxScriptLoader’
../../../PlugIns/CgProgramManager/include/OgreCgFxScriptLoader.h:1473: error: candidate is: void Ogre::CgFxScriptLoader::parseCgProgramParameters(_CGpass*, int)
OgreCgFxScriptLoader.cpp:2927: error: prototype for ‘void Ogre::CgFxScriptLoader::parseCgProgramParameter(_CGparameter*, Ogre::GpuProgramParametersSharedPtr, const Ogre::String&)’ does not match any in class ‘Ogre::CgFxScriptLoader’
../../../PlugIns/CgProgramManager/include/OgreCgFxScriptLoader.h:1474: error: candidate is: void Ogre::CgFxScriptLoader::parseCgProgramParameter(_CGparameter*, int, const Ogre::String&)
OgreCgFxScriptLoader.cpp:3360: error: prototype for ‘const bool Ogre::CgFxScriptLoader::cgSemanticToOgreAutoConstantType(const char*, Ogre::GpuProgramParameters::AutoConstantType&)’ does not match any in class ‘Ogre::CgFxScriptLoader’
../../../PlugIns/CgProgramManager/include/OgreCgFxScriptLoader.h:1480: error: candidate is: const bool Ogre::CgFxScriptLoader::cgSemanticToOgreAutoConstantType(const char*, int)
OgreCgFxScriptLoader.cpp:3576: error: prototype for ‘bool Ogre::CgFxScriptLoader::parseAutoConstantParam(_CGparameter*, Ogre::GpuProgramParametersSharedPtr, const Ogre::String&)’ does not match any in class ‘Ogre::CgFxScriptLoader’
../../../PlugIns/CgProgramManager/include/OgreCgFxScriptLoader.h:1479: error: candidate is: bool Ogre::CgFxScriptLoader::parseAutoConstantParam(_CGparameter*, int, const Ogre::String&)
OgreCgFxScriptLoader.cpp:3601: error: prototype for ‘void Ogre::CgFxScriptLoader::parseFloatCgProgramParameter(CGtype, _CGparameter*, Ogre::GpuProgramParametersSharedPtr, const Ogre::String&)’ does not match any in class ‘Ogre::CgFxScriptLoader’
../../../PlugIns/CgProgramManager/include/OgreCgFxScriptLoader.h:1477: error: candidate is: void Ogre::CgFxScriptLoader::parseFloatCgProgramParameter(CGtype, _CGparameter*, int, const Ogre::String&)
OgreCgFxScriptLoader.cpp:3677: error: prototype for ‘void Ogre::CgFxScriptLoader::parseIntCgProgramParameter(CGtype, _CGparameter*, Ogre::GpuProgramParametersSharedPtr, const Ogre::String&)’ does not match any in class ‘Ogre::CgFxScriptLoader’
../../../PlugIns/CgProgramManager/include/OgreCgFxScriptLoader.h:1478: error: candidate is: void Ogre::CgFxScriptLoader::parseIntCgProgramParameter(CGtype, _CGparameter*, int, const Ogre::String&)
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
How can I compile and get this type of errors on windows?
Watch out for my OGRE related tweets here.
- sparkprime
- Ogre Magi
- Posts: 1137
- Joined: Mon May 07, 2007 3:43 am
- Location: Ossining, New York
- x 13
- Contact:
- SunSailor
- Gnoll
- Posts: 699
- Joined: Sun Jan 02, 2005 5:45 pm
- Location: Velbert, Germany
- x 2
- Contact:
I can't tell you, as I'm currently compiling the HEAD under linux only, maxbe the error doesn't even occure under windows. My recommendation would be to set up a VM with OpenSuSE (The distribution I'm enforced to use on the computer I compiled it on) and try it there. That's the most easy way to reproduce it I can think of (beside the download, but I guess, you're well connected).Assaf Raman wrote:How can I compile and get this type of errors on windows?