ogreSwf/vektrix
- rodan_nr
- Kobold
- Posts: 37
- Joined: Thu May 18, 2006 2:59 am
- Location: Ccs, Venezuela
- Contact:
-
- Gnoblar
- Posts: 20
- Joined: Sun Sep 17, 2006 11:27 am
- Location: CO, Usa
- Contact:
Re: New?
I believe that HLSL and CG are the same language...stoneCold wrote:...
currently changing the rendering system to work with shaders, but only hlsl works (as I know it best, if you want to help with cg/glsl contact me),
...
...
As said I'd need a working CG/GLSL version of my HLSL shader, which does render the objects to view space.
...
Microsoft and nVidia worked on the project together, and then released it under two names: HLSL is packaged with DirectX, and CG is available from the nVidia developer web site.
At least that is what it said in the CG Tutorial book from nVidia...
Basically, the main difference is the file extensions...
Here is an excerpt from an nVidia Doc:
Located here:NVIDIA is well known in the industry for developing the Cg language for programmable
real-time graphics. NVIDIA and Microsoft initially collaborated to provide a common
shading language syntax and semantics. The fruits of this collaboration became
NVIDIA’s Cg and Microsoft’s High-Level Shading Language (HLSL) implementations.
http://download.nvidia.com/developer/GL ... crosoft%22
I don't have much experience with GLSL though... I believe it is different than HLSL/CG, and has extended features that are only available to OpenGL.
Hope this helps in some way...
-Josh
- Praetor
- OGRE Retired Team Member
- Posts: 3335
- Joined: Tue Jun 21, 2005 8:26 pm
- Location: Rochester, New York, US
- x 3
- Contact:
- mj
- Kobold
- Posts: 32
- Joined: Mon Mar 01, 2004 6:11 pm
- Location: Moscow, Russia
- Contact:
- mj
- Kobold
- Posts: 32
- Joined: Mon Mar 01, 2004 6:11 pm
- Location: Moscow, Russia
- Contact:
- :wumpus:
- OGRE Retired Team Member
- Posts: 3067
- Joined: Tue Feb 10, 2004 12:53 pm
- Location: The Netherlands
- x 1
Do you have any source for this statement? (besides MS itself)Praetor wrote:Same language, different everything else. Cg is cross platform, but HLSL has a much better compiler. The Cg toolkit does not compile Cg code very well, and it is behind the times compared to HLSL. I believe they still dont support Sm3.0 stuff.
As I've heard the Cg compiler is actually known to be very good, especially at compiling to the NVidia specific profiles like fp/vp30/40. (vp/fp40 is equivalent to SM3.0)
-
- Kobold
- Posts: 36
- Joined: Mon Sep 11, 2006 11:46 am
- mj
- Kobold
- Posts: 32
- Joined: Mon Mar 01, 2004 6:11 pm
- Location: Moscow, Russia
- Contact:
- Praetor
- OGRE Retired Team Member
- Posts: 3335
- Joined: Tue Jun 21, 2005 8:26 pm
- Location: Rochester, New York, US
- x 3
- Contact:
It mainly comes from the fact that last time I checked out the Cg toolkit (a couple months ago) they still didn't have Sm3.0 in there. Also, sometimes shaders that are compiled with HLSL compiler fit into the lower profiles but can't with Cg. For instance, sometimes something that compiles at 1.4 with HLSL has to compile in 2.0 for Cg. I know that their compiler was a major point they have been working on. Things could have turned around now, and I hope they have. I would prefer a cross-platform solution.:wumpus: wrote: Do you have any source for this statement? (besides MS itself)
As I've heard the Cg compiler is actually known to be very good, especially at compiling to the NVidia specific profiles like fp/vp30/40. (vp/fp40 is equivalent to SM3.0)
-
- Gnoblar
- Posts: 5
- Joined: Thu Oct 12, 2006 2:40 am
- stoneCold
- OGRE Expert User
- Posts: 867
- Joined: Fri Oct 01, 2004 9:13 pm
- Location: Carinthia, Austria
- x 1
[UPDATE] ogreSwf BETA 0.1
Hi folks, after quite a long time I'm back again.
I have had some big changes in my all day life the last month which made it very hard to keep development of ogreSwf consistent. The whole story could fill up a forum page or two, but I won't bore you with details, so back to the topic
The last days I have had enough time to shorten my TODO list on ogreSwf and to finish the last feature I wanted to implement (rendering as 3D scene object, explained later ---> screenshot).
I called this current version ogreSwf BETA_0.1
(because "Beta" == all main features included + some additions and tweaks needed)
I will add some missing/useful functions to the API, when I have time to do so. (get***, set***, etc.)
the three main rendering types are:
1) rendering to Ogre::Texture: the resulting texture can be used on any 3D surface you can apply materials to.
Though it is a texture, there are no limitations of interactivity (mouse support, read/write variables, etc.)
2) rendering to screen: use Swf files as GUIs and HUDs
3) rendering as 3D scene object: this is a very powerful feature which I implemented the last days. It's very similar to the way Doom3 creates it's ingame control panels. It doesn't use a RenderTexture to display the Swf, but it directly displays the swf as scene object. This object can be attached to Nodes, can be rotated/scaled/translated and the main advantage to the SwfTexture (see 1) is, that you get a MUCH better performance, because the RenderTexture takes most of the updating time. Additionally the SwfPanel displays a sharp result, where a SwfTexture can be unsharp if the RenderTexture's resolution is too low. SwfTextures are mainly needed if you want to display a Swf on a very curved surface, but if you just need flat swf panels you should use the scene object attempt (SwfPanel).
Enough of long explanations...here's a screenshot of the current demo, showing the three rendering features
here's a short video of the demo: Demo_ogreSwf.avi (2.9 MB)
and finally the long awaited full source + demo: ogreSwf_BETA_0.1.rar (1.31 MB)
ideas, proposals, wanted features, ... are welcome
greetings
Hi folks, after quite a long time I'm back again.
I have had some big changes in my all day life the last month which made it very hard to keep development of ogreSwf consistent. The whole story could fill up a forum page or two, but I won't bore you with details, so back to the topic
The last days I have had enough time to shorten my TODO list on ogreSwf and to finish the last feature I wanted to implement (rendering as 3D scene object, explained later ---> screenshot).
I called this current version ogreSwf BETA_0.1
(because "Beta" == all main features included + some additions and tweaks needed)
I will add some missing/useful functions to the API, when I have time to do so. (get***, set***, etc.)
the three main rendering types are:
1) rendering to Ogre::Texture: the resulting texture can be used on any 3D surface you can apply materials to.
Though it is a texture, there are no limitations of interactivity (mouse support, read/write variables, etc.)
2) rendering to screen: use Swf files as GUIs and HUDs
3) rendering as 3D scene object: this is a very powerful feature which I implemented the last days. It's very similar to the way Doom3 creates it's ingame control panels. It doesn't use a RenderTexture to display the Swf, but it directly displays the swf as scene object. This object can be attached to Nodes, can be rotated/scaled/translated and the main advantage to the SwfTexture (see 1) is, that you get a MUCH better performance, because the RenderTexture takes most of the updating time. Additionally the SwfPanel displays a sharp result, where a SwfTexture can be unsharp if the RenderTexture's resolution is too low. SwfTextures are mainly needed if you want to display a Swf on a very curved surface, but if you just need flat swf panels you should use the scene object attempt (SwfPanel).
Enough of long explanations...here's a screenshot of the current demo, showing the three rendering features
here's a short video of the demo: Demo_ogreSwf.avi (2.9 MB)
and finally the long awaited full source + demo: ogreSwf_BETA_0.1.rar (1.31 MB)
ideas, proposals, wanted features, ... are welcome
greetings
Last edited by stoneCold on Sat Nov 25, 2006 1:25 am, edited 2 times in total.
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Wow, this is great!
I really like what you've done with option 3!
Is this different from what I just pulled from the CVS?Download Page wrote:Due to current high demand, the page you are looking for cannot be delivered right now.
I really like what you've done with option 3!
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- stoneCold
- OGRE Expert User
- Posts: 867
- Joined: Fri Oct 01, 2004 9:13 pm
- Location: Carinthia, Austria
- x 1
fixed the link (I have to get my own website up again)jacmoe wrote:Wow, this is great!
Is this different from what I just pulled from the CVS?Download Page wrote:Due to current high demand, the page you are looking for cannot be delivered right now.
I really like what you've done with option 3!
option 3 is also my favourite, fast and sharp shaped
I'm glad that the CVS works now, yesterday I uploaded my current version, but when doing a checkout anonymous, it didn't work. Today it does.
So ... everyone who likes CVS, go get ogreSwf from "ogreaddons/ogreswf"
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
- syedhs
- Silver Sponsor
- Posts: 2703
- Joined: Mon Aug 29, 2005 3:24 pm
- Location: Kuala Lumpur, Malaysia
- x 51
-
- Ogre Magi
- Posts: 1266
- Joined: Tue Aug 12, 2003 1:53 am
- Location: Melbourne, Australia
- x 1
- Contact:
-
- Gnome
- Posts: 351
- Joined: Thu Oct 21, 2004 1:34 pm
- Location: Diepenbeek, Belgium
- x 3
- Contact:
- stoneCold
- OGRE Expert User
- Posts: 867
- Joined: Fri Oct 01, 2004 9:13 pm
- Location: Carinthia, Austria
- x 1
@ syedhs: this release is for dagon (I'm currently using 1.2.3 too), but should be compatible with eihort (not tried it yet).
@syedhs / Vectrex: yeah, yesterday (when I already laid in bed ) I remembered that I forgot to mention this. Ogre has no _setBounds(); function for ManualObject by default. Therefore I added it myself...
add the code to the files, build Ogre and everything should work well.
I hope there's a good chance of integrating this function permanently to Ogre, because it's quite trivial and in some cases essential to have this function for ManualObjects. I know I could have done ManualObject::convertToMesh, but you might understand that doing that once a frame + deleting the mesh after each frame would be a BIT unperformant sorry for my obliviousness.
@syedhs / Vectrex: yeah, yesterday (when I already laid in bed ) I remembered that I forgot to mention this. Ogre has no _setBounds(); function for ManualObject by default. Therefore I added it myself...
Code: Select all
//------------------
//OgreManualObject.h
//------------------
public:
...
void _setBounds(const AxisAlignedBox& bounds, bool pad = true);
...
Code: Select all
//--------------------
//OgreManualObject.cpp
//--------------------
namespace Ogre
{
...
void ManualObject::_setBounds(const AxisAlignedBox& bounds, bool pad)
{
mAABB = bounds;
Vector3 max = mAABB.getMaximum();
Vector3 min = mAABB.getMinimum();
if (pad)
{
// Pad out the AABB a little, helps with most bounds tests
Vector3 scaler = (max - min) * MeshManager::getSingleton().getBoundsPaddingFactor();
mAABB.setExtents(min - scaler, max + scaler);
}
else
{
mAABB.setExtents(min, max);
}
}
...
};
I hope there's a good chance of integrating this function permanently to Ogre, because it's quite trivial and in some cases essential to have this function for ManualObjects. I know I could have done ManualObject::convertToMesh, but you might understand that doing that once a frame + deleting the mesh after each frame would be a BIT unperformant sorry for my obliviousness.
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
- Troglodit
- Gremlin
- Posts: 160
- Joined: Tue May 25, 2004 2:18 pm
- Location: Ukraine/Ternopil
- Contact:
Great work !
Perhaps I put all 512x512 textures of game in separate swf file (one texture per frame).
Can I somehow render those textures to independent textures, put it to meshes and then completely disable processing of those swf file for increase fps ?
If Yes then OgreSWF can be also very useful for contain vector textures with gradients (small size! ) and png transparent textures (png with alpha channel in flash can be compressed with jpeg compression)
Also how about action script function LoadMovie ? Can swf inside ogre load images and other movies ?
Also how about sound in swf ? Is it possible to play it ?
Perhaps I put all 512x512 textures of game in separate swf file (one texture per frame).
Can I somehow render those textures to independent textures, put it to meshes and then completely disable processing of those swf file for increase fps ?
If Yes then OgreSWF can be also very useful for contain vector textures with gradients (small size! ) and png transparent textures (png with alpha channel in flash can be compressed with jpeg compression)
Also how about action script function LoadMovie ? Can swf inside ogre load images and other movies ?
Also how about sound in swf ? Is it possible to play it ?
Arsen Gnatkivsky
game development, programming, modeling.
Magic of Stonehenge demo
http://www.ogre3d.ru - Russian OGRE site. Welcome !
game development, programming, modeling.
Magic of Stonehenge demo
http://www.ogre3d.ru - Russian OGRE site. Welcome !
- syedhs
- Silver Sponsor
- Posts: 2703
- Joined: Mon Aug 29, 2005 3:24 pm
- Location: Kuala Lumpur, Malaysia
- x 51
I think you have a good reason there, well the final decision is Sinbad's.Stonecold wrote: I hope there's a good chance of integrating this function permanently to Ogre, because it's quite trivial and in some cases essential to have this function for ManualObjects. I know I could have done ManualObject::convertToMesh, but you might understand that doing that once a frame + deleting the mesh after each frame would be a BIT unperformant
- stoneCold
- OGRE Expert User
- Posts: 867
- Joined: Fri Oct 01, 2004 9:13 pm
- Location: Carinthia, Austria
- x 1
I don't really understand / what advantage has it...describeTroglodit wrote:Perhaps I put all 512x512 textures of game in separate swf file (one texture per frame).
You can render as many independent SwfTextures as you want (at least as many as your hardware can handle). Yes it is possible to completely disable updatingTroglodit wrote:Can I somehow render those textures to independent textures, put it to meshes and then completely disable processing of those swf file for increase fps ?
Code: Select all
SwfTexture::setUpdateProperties(false, false);
If I understand you right you want to use flash in ogre just to compress your textures?!Troglodit wrote:If Yes then OgreSWF can be also very useful for contain vector textures with gradients (small size! ) and png transparent textures (png with alpha channel in flash can be compressed with jpeg compression)
I don't really see the advantage and I don't think this will be performant in any way, because each SwfTexture needs an RTT call (as said above) which is very expensive. ogreSwf main task should be to bring interactive SWF movies to ogre, so using it with 1 frame SWFs is somehow overkill, except you need it for example to display the players name on his back like done in F.E.A.R.s multiplayer.
No (not atm), but I don't see the need here too, just load up a new SwfTexture instance in code if you need one, and you should be fineTroglodit wrote:Also how about action script function LoadMovie ? Can swf inside ogre load images and other movies ?
There IS some sound code in gameswf, but I did not yet integrate it, because of the same reason mentioned above. It would enforce you to use only 2D sound for example. It's more flexible to control your sound engine of choice with a swf file, than beeing fixed to 2D sound or maybe even beeing fixed to a sound engine of my choiceTroglodit wrote:Also how about sound in swf ? Is it possible to play it ?
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
- Troglodit
- Gremlin
- Posts: 160
- Joined: Tue May 25, 2004 2:18 pm
- Location: Ukraine/Ternopil
- Contact:
Of course not only for compress I know why you make ogreSwf (gui, dynamic textures) it is very useful.If I understand you right you want to use flash in ogre just to compress your textures?!
Yust you can use flash fo generate vector procedural textures like wood, noise etc.
That is a question: can I render/convert/whatever 1 frame from swf to absolutly simple texture in memory, which will not call RTT or anything else? And then just unload swf?I don't really see the advantage and I don't think this will be performant in any way, because each SwfTexture needs an RTT call (as said above) which is very expensive. ogreSwf main task should be to bring interactive SWF movies to ogre, so using it with 1 frame SWFs is somehow overkill, except you need it for example to display the players name on his back
think about ability for game to download and show textures and data directly from internet without any third party libs. It can be very useful for MMORPGs for example. You will can show news in game.No (not atm), but I don't see the need here too, just load up a new SwfTexture instance in code if you need one, and you should be fine
Arsen Gnatkivsky
game development, programming, modeling.
Magic of Stonehenge demo
http://www.ogre3d.ru - Russian OGRE site. Welcome !
game development, programming, modeling.
Magic of Stonehenge demo
http://www.ogre3d.ru - Russian OGRE site. Welcome !
- stoneCold
- OGRE Expert User
- Posts: 867
- Joined: Fri Oct 01, 2004 9:13 pm
- Location: Carinthia, Austria
- x 1
Tell me how it's done in flash then I can test it (never heard of it yet).Troglodit wrote:Yust you can use flash fo generate vector procedural textures like wood, noise etc.
Will integrate this, nice ideaTroglodit wrote:That is a question: can I render/ronvert/whatever 1 frame from swf to absolutly simple texture in memory, which will not call RTT or anything else? And then just unload swf?
This task is not really up to ogreSwf (not even to a third party lib), but up to Ogre itself. ogreSwf uses Ogre's resource loading system, therefore it's possible to store SWFs in zip archives or directly on the hardisk out of the box. If you want more options to load data from, just extend Ogre's resource system and you will be fine. So every kind of resource is possible. HTTP, FTP, ... , even vinyls if you just manage to find/code an ogre archive factory for itTroglodit wrote:think about ability for game to download and show textures and data directly from internet without any third party libs. It can be very useful for MMORPGs for example. You will can show news in game.
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
- Troglodit
- Gremlin
- Posts: 160
- Joined: Tue May 25, 2004 2:18 pm
- Location: Ukraine/Ternopil
- Contact:
Perfect !Will integrate this, nice idea Wink
of course ! Look:Tell me how it's done in flash then I can test it (never heard of it yet).
here is generic noise texture 256x256(not tiled yet):
swf-http://www.ogre3d.org.ru/trogl/noise.swf
fla-http://www.ogre3d.org.ru/trogl/noise.fla
Every time you run movie noise will be different.
And here tiled vector wood texture:
swf-http://www.ogre3d.org.ru/trogl/wood.swf
fla-http://www.ogre3d.org.ru/trogl/wood.fla
now about size (jpegs are very compressed !).
noice.jpg - 14kB , noise.swf - 670 bytes !
wood.jpg - 23kB , wood.swf - 798 bytes !
What you think ?
Arsen Gnatkivsky
game development, programming, modeling.
Magic of Stonehenge demo
http://www.ogre3d.ru - Russian OGRE site. Welcome !
game development, programming, modeling.
Magic of Stonehenge demo
http://www.ogre3d.ru - Russian OGRE site. Welcome !