ogreSwf/vektrix

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Post by stoneCold »

I see, but I doubt the use of it.
Why write ""complicated"" functions in flash, where you could easily achive a MUCH more realistic wood patern in photoshop in half of the time...
and such a noise texture can be created much more easily in code if it HAS to be dynamic.

For the size argument: I recently bought / installed SplinterCell: Double Agent on my system. Required space ~10 GB, and this is just the beginning. I guess games like crysis will break this 10GB barrier significantly. This is no problem as we live in times where TeraByte HDD sizes start to become usual.
So who counts bits when we have HDD space at the ratio of 8 * 10^12 :wink:
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
User avatar
Falagard
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2060
Joined: Thu Feb 26, 2004 12:11 am
Location: Toronto, Canada
x 4

Post by Falagard »

Procedural texture generation is good to keep game download sizes small, specifically for games like Xbox Live Arcade which have a 50 mb limit.

http://www.allegorithmic.com/v2/ProFX_1.htm

The above solution exists specifically to solve the problem.

There's a game that uses Unreal Engine 3 and most textures are generated procedurally and it's under 50 mbs.

http://www.allegorithmic.com/v2/ProFX_roboblitz.htm
User avatar
Troglodit
Gremlin
Posts: 160
Joined: Tue May 25, 2004 2:18 pm
Location: Ukraine/Ternopil

Post by Troglodit »

2 stoneCold
Right now I creating shareware game and size is really pain in ass, because shareware game must be about 20-30 Mb.

Now lets talk about compression of simple (raster) textures 512x512 with alpha channel.
So for now we have 3 variants:
png-24, tga, dds


png and tga is near - about 445KB.
http://www.ogre3d.org.ru/trogl/1/geroy2_.png

dds is more better - compressed it have 107 kB
http://www.ogre3d.org.ru/trogl/1/geroy2_.dds

now lets import png to flash and compress with jpeg compression.
look:
http://www.ogre3d.org.ru/trogl/1/Untitled-1.html
70 kb with alpha channel ! And this is not biggest compression.

So as you can see we can have additional interesting use of ogreSwf ;)
Arsen Gnatkivsky
game development, programming, modeling.
Magic of Stonehenge demo
http://www.ogre3d.ru - Russian OGRE site. Welcome !
Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1

Post by Vectrex »

brilliant work! A few questions
- What level of actionscript is supported? I few flash 8 swfs I tried went a bit weird :) So I assume it's more like flash 6, AS v1.0
- I know antialiasing is something that gameSwf never had. Any chance of it in the future?
- Do you have an example of mapping the 2d mouse to be able to interact whereever the flash is on screen? At the moment it's irrelevant when the flash is actually positioned.
Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1

Post by Vectrex »

Troglodit wrote:2 stoneCold
Right now I creating shareware game and size is really pain in ass, because shareware game must be about 20-30 Mb.

Now lets talk about compression of simple (raster) textures 512x512 with alpha channel.
So for now we have 3 variants:
png-24, tga, dds


png and tga is near - about 445KB.
http://www.ogre3d.org.ru/trogl/1/geroy2_.png

dds is more better - compressed it have 107 kB
http://www.ogre3d.org.ru/trogl/1/geroy2_.dds

now lets import png to flash and compress with jpeg compression.
look:
http://www.ogre3d.org.ru/trogl/1/Untitled-1.html
70 kb with alpha channel ! And this is not biggest compression.

So as you can see we can have additional interesting use of ogreSwf ;)
If I were you I would look into jpeg2k for your texture compression. That would beat anything flash could do by many times. DDS is still fairly good mainly because it's small inside the graphics card as well.
User avatar
Troglodit
Gremlin
Posts: 160
Joined: Tue May 25, 2004 2:18 pm
Location: Ukraine/Ternopil

Post by Troglodit »

If I were you I would look into jpeg2k for your texture compression.
Is jpeg2000 support alpha channel ? Nad Ogre for now dont support jpeg2000 as i know.
DDS is still fairly good mainly because it's small inside the graphics card as well.
Really ? Is png 512x512 and dds 512x512 have different size in video memory ?
Arsen Gnatkivsky
game development, programming, modeling.
Magic of Stonehenge demo
http://www.ogre3d.ru - Russian OGRE site. Welcome !
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Post by stoneCold »

Vectrex wrote:- What level of actionscript is supported? I few flash 8 swfs I tried went a bit weird :) So I assume it's more like flash 6, AS v1.0
Yesterday I downloaded the gameSwf stable source from 2006-02-27 (once again) and saw that I rejected it to early, because there's only one quite major main bug which should nonetheless be solveable. Besides this version has just PROs. The most important is, that it has a quite high level of AS/Flash support. Therefore I'm planing to integrate this version of gameSwf the next days / week.
Vectrex wrote:I know antialiasing is something that gameSwf never had. Any chance of it in the future?
I already heard the question for AA a couple of times, so I now will have to clearify my and your thoughts about it. You want AA for SwfTextures? Meaning the final rendertexture should be anti-aliased? But in this case, the SwfPanel feature (option 3 :wink: ) should exactly be the thing you want. It gives you a sharp 3D scene object, and then it just depends on screen anti-aliasing. Same applies for SwfHUDs.
Vectrex wrote:- Do you have an example of mapping the 2d mouse to be able to interact whereever the flash is on screen? At the moment it's irrelevant when the flash is actually positioned.
Nice coincidence :D Yesterday I started to create a demo which will show exactly what you ask for :wink:
Vectrex wrote:If I were you I would look into jpeg2k for your texture compression. That would beat anything flash could do by many times. DDS is still fairly good mainly because it's small inside the graphics card as well.
Exactly what I would've said.

greetings
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
User avatar
SuprChikn
Bugbear
Posts: 863
Joined: Tue Apr 19, 2005 6:10 am
Location: Melbourne, Aus

Post by SuprChikn »

Troglodit wrote:Really ? Is png 512x512 and dds 512x512 have different size in video memory ?
As I understand it, many graphics cards support DDS compression, so the image can remain in compressed form while it is being used. All other formats have to be decompressed, and so take up the same memory at runtime as a BMP equivalent.

Someone else feel free to correct me or clarify where needed.
Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1

Post by Vectrex »

Troglodit wrote:
If I were you I would look into jpeg2k for your texture compression.
Is jpeg2000 support alpha channel ? Nad Ogre for now dont support jpeg2000 as i know.
DDS is still fairly good mainly because it's small inside the graphics card as well.
Really ? Is png 512x512 and dds 512x512 have different size in video memory ?
jpeg2k supports alpha. There are libs around that you could use.
Also I'm fairly sure DDS stays compressed on most gfx cards
User avatar
Troglodit
Gremlin
Posts: 160
Joined: Tue May 25, 2004 2:18 pm
Location: Ukraine/Ternopil

Post by Troglodit »

Now I understand. Thanks ! :)
Arsen Gnatkivsky
game development, programming, modeling.
Magic of Stonehenge demo
http://www.ogre3d.ru - Russian OGRE site. Welcome !
User avatar
independentCreations
Greenskin
Posts: 121
Joined: Sat Jan 07, 2006 7:30 am
Location: Gold Coast - Australia

Post by independentCreations »

THIS IS SO SEXY!!

I love it, am yet to try to implement it, but the movie looks great. Can think of so many uses. One of my artists was brought up on flash so this will definetly help with development time of menus. No more 1000 of lines of complex cegui implementations.

Great work

p.s i thought of implementing this, but found out you had before me :P dang
Final Creations - Tech Leader For 'The Broken'
v2i - Tech Leader For Architectual Sim.
Ogre Enthusiast
magnumpc
Gnoblar
Posts: 9
Joined: Thu Apr 15, 2004 3:59 pm

Problem with debug mode? Also, found bug in xplatform.h

Post by magnumpc »

stonecold: Thanks for the wonderful OgreSWF! I just wanted to point out a couple of problems in debug mode in case you or anyone else hasn't run into them yet:

1. in xplatform.h (L16),

Code: Select all

	char *temp;  // <-- error
	bool appFound = false;

	FILE* file = fopen(cFileName.c_str(), "r");

	if(!file)
	{
		cReturnedString = cDefault;
		return;
	}


	while(!feof(file))
	{
		fscanf(file, "%s", temp);
		if(std::string(temp) == "[" + cAppName + "]")
			break;
	}

Code: Select all

	char temp[512];  // <-- works now
	bool appFound = false;

	FILE* file = fopen(cFileName.c_str(), "r");

	if(!file)
	{
		cReturnedString = cDefault;
		return;
	}


	while(!feof(file))
	{
		fscanf(file, "%s", temp);
		if(std::string(temp) == "[" + cAppName + "]")
			break;
	}

2. in define_bits_lossless_2_loader() in gameswf_impl.cpp (L1987), the code blows up on delete [] buffer;

Code: Select all

				if (bitmap_format == 3)
				{
					// 8-bit data, preceded by a palette.

					const int	bytes_per_pixel = 1;
					int	color_table_size = in->read_u8();
					color_table_size += 1;	// !! SWF stores one less than the actual size

					int	pitch = (width * bytes_per_pixel + 3) & ~3;

					int	buffer_bytes = color_table_size * 4 + pitch * height;
					Uint8*	buffer = new Uint8[buffer_bytes];

					inflate_wrapper(in->get_underlying_stream(), buffer, buffer_bytes);
					assert(in->get_position() <= in->get_tag_end_position());

					Uint8*	color_table = buffer;

					for (int j = 0; j < height; j++)
					{
						Uint8*	image_in_row = buffer + color_table_size * 4 + j * pitch;
						Uint8*	image_out_row = image::scanline(image, j);
						for (int i = 0; i < width; i++)
						{
							Uint8	pixel = image_in_row[i * bytes_per_pixel];
							image_out_row[i * 4 + 0] = color_table[pixel * 4 + 0];
							image_out_row[i * 4 + 1] = color_table[pixel * 4 + 1];
							image_out_row[i * 4 + 2] = color_table[pixel * 4 + 2];
							image_out_row[i * 4 + 3] = color_table[pixel * 4 + 3];
						}
					}

					delete [] buffer;    // <-- blows up here (haven't had chance to look into it)
				}
Thanks for the incredible work on OgreSWF, stonecold! I look forward to your next rev and I hope my post was of some use.

Ron

btw: Release mode works as advertised!
User avatar
MattMihaly
Corporate Sponsor
Corporate Sponsor
Posts: 30
Joined: Fri Sep 01, 2006 9:16 pm
Location: Mill Valley, California

Post by MattMihaly »

stoneCold wrote:I see, but I doubt the use of it.
For the size argument: I recently bought / installed SplinterCell: Double Agent on my system. Required space ~10 GB, and this is just the beginning. I guess games like crysis will break this 10GB barrier significantly. This is no problem as we live in times where TeraByte HDD sizes start to become usual.
So who counts bits when we have HDD space at the ratio of 8 * 10^12 :wink:
I know a couple others pointed out that size does matter in some cases. In our case, for instance, we're working on an Ogre game that has a small initial download and then streams in the background as the user plays. Size ends up mattering a fair amount in that case, particularly for people trying to play on slower (non-broadband) connections.

AWESOME work on ogreSWF btw. This is really nice stuff.
--matt
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

stonecold, pepole are talking about us here:
http://www.screwtape-studios.com/phpBB/ ... 6d06203ff4

Look for your name.
Watch out for my OGRE related tweets here.
CharlesFXD
Gnoblar
Posts: 1
Joined: Mon Dec 11, 2006 2:26 pm

Post by CharlesFXD »

Shhhh...you dont know who's watching.... :shock:

but we at Fleets are eagerly looking forward to and watching the development of this. best of luck guys
User avatar
Alexander
Gremlin
Posts: 175
Joined: Sat Aug 05, 2006 3:55 am

Post by Alexander »

Stonecold,

Great project! This will expedite GUI creation for our team by a considerable amount!

How is progress coming? From what I could glean from your blog ( note, my German is awful ), you're looking from gameSWF elsewhere currently?
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Post by stoneCold »

Currently I'm looking into SwfTools which also feature a quite good Swf parser (SwfDump) and a Swf file extractor (to extract swf-concluded data eg. sounds, images, etc.). With the help of these it should be possible to get rid of gameswf (which is the main problem during development of ogreSwf, it causes more trouble than stability). Though the SwfTools just feature Linux makefiles and no win32 (VC) projects.

So currently I'm trying to get them to compile on win32. If this major step has been done I can go on writing a dedicated and (different from gameswf) object oriented SWF renderer.
We'll see how that comes along, else I'll have to stick with gameswf, where the current (but by all means not the only) problem is the implementation of button/element scaling using the AS commands "_width" and "_height" as they don't imply a simple scaling factor, but an exact size which should result.

I just recognised that no code was implemented for "_width" / "_height" scaling when I was working on the next demo app which should showcase GUI features -----> see this swf file, which is also the test file for the problem

if someone is interested in helping...
my current gameswf build (12_2006)
search for "//TODO: scaling with "_width" command doesn't work properly" in gameswf_button.cpp. That's where the problem resists, maybe you have more luck than me :wink: (I'll though keep trying)

btw, merry christmas and a happy new year to all of you Image
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
Fenris
Kobold
Posts: 25
Joined: Wed Apr 23, 2003 6:39 pm

Post by Fenris »

This is pretty darn neat, DLing to check it out now.
stoneCold wrote:Currently I'm looking into SwfTools which also feature a quite good Swf parser (SwfDump) and a Swf file extractor (to extract swf-concluded data eg. sounds, images, etc.). With the help of these it should be possible to get rid of gameswf (which is the main problem during development of ogreSwf, it causes more trouble than stability). Though the SwfTools just feature Linux makefiles and no win32 (VC) projects.
Hmm, isn't that GPLed?
Always remember: Weeks of coding can save hours of planning
Fenris
Kobold
Posts: 25
Joined: Wed Apr 23, 2003 6:39 pm

Post by Fenris »

Which version of Ogre should one use? I tried 1.2.4 but _setBounds said no way, I don't exist yet/anymore (or reasonably close to it)...

Code: Select all

		SceneNode* objectNode = mRenderNode->createChildSceneNode();
		manualObject->_setBounds(AxisAlignedBox(-mMovieDefinition->get_width() * 0.005, -mMovieDefinition->get_height() * 0.005, 0.0, mMovieDefinition->get_width() * 0.005, mMovieDefinition->get_height() * 0.005, 0.0));
		objectNode->attachObject(manualObject);
Always remember: Weeks of coding can save hours of planning
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Post by stoneCold »

Fenris wrote:Which version of Ogre should one use? I tried 1.2.4 but _setBounds said no way, I don't exist yet/anymore (or reasonably close to it)...
ogreSwf should work with any dagon version of ogre.
The _setBounds function was added to integrate the rendering as sceneobject feature.
Did you get the source from cvs? if yes then check the INSTALL.TXT, it tells you how to add the function to the ogre core.
zaitochi
Halfling
Posts: 50
Joined: Wed Oct 19, 2005 1:53 pm

Post by zaitochi »

Hi stoneCold, ogreSwf is a very nice tool. I have a question that I cannot compile ogreSwf in debug mode, only in Release mode, how can I fix it?

In build log of vc8 it says that is a tool of Error Prompt Report.

Thanks for help
RedEagle
Gnoblar
Posts: 22
Joined: Thu Jan 04, 2007 9:39 pm

Post by RedEagle »

Hello everyone! I´m hopping to use ogreswf in order to make a full multimedia presentation on ogre... What I mean by full, is that it would be nice to be able to present a SWF file wich contains at least text, video and audio.
What I would like to ask is if the latest gameSWF version (gameswf-2006-02-27) that stonecold is tryng to implement supports flv videos or not. By what I have been able to test (and read once or twice) it does not support video. Is this correct or was I (hopefully) mislead :lol:

Thank you all and have a GREAT year :wink:
Fenris
Kobold
Posts: 25
Joined: Wed Apr 23, 2003 6:39 pm

Post by Fenris »

[quote="stoneColdogreSwf should work with any dagon version of ogre.
The _setBounds function was added to integrate the rendering as sceneobject feature.
Did you get the source from cvs? if yes then check the INSTALL.TXT, it tells you how to add the function to the ogre core.[/quote]

Thanks, once I got it from CVS that did the trick
Always remember: Weeks of coding can save hours of planning
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Post by stoneCold »

RedEagle wrote:Hello everyone! I´m hopping to use ogreswf in order to make a full multimedia presentation on ogre... What I mean by full, is that it would be nice to be able to present a SWF file wich contains at least text, video and audio.
What I would like to ask is if the latest gameSWF version (gameswf-2006-02-27) that stonecold is tryng to implement supports flv videos or not. By what I have been able to test (and read once or twice) it does not support video. Is this correct or was I (hopefully) mislead :lol:

Thank you all and have a GREAT year :wink:
the latest (stable) version of gameswf doesn't support video. There is some support for audio, but because Ogre is a rendering API, I didn't think about implementing this feature because this would already involve a 3rd party sound engine.
I thought that it would be better to let the user choose his own favourite sound engine and let ogreSwf control the sound engine in the application code rather than internally.

[edit]:
Fenris wrote:
stoneCold wrote:Currently I'm looking into SwfTools which also feature a quite good Swf parser (SwfDump) and a Swf file extractor (to extract swf-concluded data eg. sounds, images, etc.). With the help of these it should be possible to get rid of gameswf (which is the main problem during development of ogreSwf, it causes more trouble than stability). Though the SwfTools just feature Linux makefiles and no win32 (VC) projects.
Hmm, isn't that GPLed?
Yes they are, but as far as I know the GPL this should be no problem as far as ogreSwf stays GPL too.
Fenris
Kobold
Posts: 25
Joined: Wed Apr 23, 2003 6:39 pm

Post by Fenris »

Hmm, isn't that GPLed?
Yes they are, but as far as I know the GPL this should be no problem as far as ogreSwf stays GPL too.
Eh? I see LGPL listed in the OgreSWF source files... If you intend to change to GPL licensing would that not mean that all source code that uses ogreSWF code, including apps we write, have to be distributed as source as well? Not pretty if so, sadly a game breaker for a lot of us I bet.
Always remember: Weeks of coding can save hours of planning