[SoC 2009 - Accepted] Unified Samples Framework & Browser

Threads related to Google Summer of Code
Post Reply
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by sinbad »

Looks like masterfalcon already dealt with this on the iPhone, I think we just need to make that universal for a static library build. Testing this patch now:

Code: Select all

Index: Samples/Browser/CMakeLists.txt
===================================================================
--- Samples/Browser/CMakeLists.txt	(revision 9176)
+++ Samples/Browser/CMakeLists.txt	(working copy)
@@ -51,21 +51,13 @@
 	${CMAKE_SOURCE_DIR}/Samples/Common/include/OgreStaticPluginLoader.h
 )
 
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
+
 if (OGRE_STATIC)
-  if (OGRE_BUILD_PLATFORM_IPHONE)
 	include_directories(
-      ${CMAKE_CURRENT_SOURCE_DIR}/include
       ${CMAKE_SOURCE_DIR}/Components/Paging/include
       ${CMAKE_SOURCE_DIR}/Components/Terrain/include
       ${CMAKE_SOURCE_DIR}/Samples/**)
-  else()
-    include_directories(
-      ${CMAKE_CURRENT_SOURCE_DIR}/include
-      ${CMAKE_SOURCE_DIR}/Components/Paging/include
-      ${CMAKE_SOURCE_DIR}/Components/Terrain/include)
-  endif()
-else()
-  include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
 endif()
 
 add_executable(SampleBrowser WIN32 ${HEADER_FILES} ${SOURCE_FILES} ${RESOURCE_FILES})
[edit]No, that doesn't work because the "**" expansion is not done by CMake, it's relying on XCode to do it, so it doesn't work in MSVC et al. Anyone know a nice way to find all subdirs (not just one as in find_path) in CMake and add them to a variable? Would be nice not to have to update this every time a new sample is added.
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by masterfalcon »

Perhaps using the regex or glob options in Cmake?

[Edit] I haven't tried this yet(family gatherings this weekend eating up all my time), but maybe:

Code: Select all

file (GLOB SAMPLE_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/Samples/*/include)
User avatar
Noman
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 714
Joined: Mon Jan 31, 2005 7:21 pm
Location: Israel
x 2
Contact:

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by Noman »

OK...
I prefer to wait until omniter finishes his sample framework article to start converting demos in order to proof read his tutorial and make sure its OK, and also, of course, because I'm lazy and want to have it explained to me before I jump in :)

Once omniter does it, I'll port a simple demo over to the framework to make sure that I got things down, and then start working on more advanced demos, probably starting with deferred shading...
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by masterfalcon »

masterfalcon wrote:Perhaps using the regex or glob options in Cmake?

[Edit] I haven't tried this yet(family gatherings this weekend eating up all my time), but maybe:

Code: Select all

file (GLOB SAMPLE_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/Samples/*/include)
This actually does exactly what sinbad was talking about. Works like a charm and doesn't add directories that don't exist too! I'm gonna check it in
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by sinbad »

@masterfalcon: Cool, I was starting to play with GLOB too but the documentation seemed to suggest it was just files rather than folders and I ran out of time to experiment, was going to try it this morning. Thanks for sorting it out!
User avatar
omniter
OGRE Contributor
OGRE Contributor
Posts: 424
Joined: Thu Mar 19, 2009 8:08 am
Location: Canada
x 44

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by omniter »

I'll definitely have the article up sometime in the next 3 days. :)
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by sinbad »

sinbad wrote:@masterfalcon: Cool, I was starting to play with GLOB too but the documentation seemed to suggest it was just files rather than folders and I ran out of time to experiment, was going to try it this morning. Thanks for sorting it out!
Hmm, actually this has a little problem on Windows / Visual Studio - I think it's blowing the command-line length limit because it starts complaining about missing a source file argument, unless I randomly truncate the include list. Bah, silly Windows.

So instead, I've make CMake copy the sample include files to a new temporary folder in the build tree and referenced that instead. It's a bit hacky but it works, and luckily this only affects our sample browser so there's no need to install things like this.
User avatar
Noman
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 714
Joined: Mon Jan 31, 2005 7:21 pm
Location: Israel
x 2
Contact:

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by Noman »

I ported the deferred shading demo to the new framework, but didn't commit it yet, because there are some minor things I don't know how to do yet :
- How do I get the demo to get listed in the samples.cfg file? It already gets built as part of the main solution, but doesn't get added there.
- Where do the screenshots go?

Thats it, I think. Very intuitive framework!

Once I get these two down, I'll commit the demo in and move on to the compositor demo, which will be more work since its very gui-heavy.
User avatar
omniter
OGRE Contributor
OGRE Contributor
Posts: 424
Joined: Thu Mar 19, 2009 8:08 am
Location: Canada
x 44

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by omniter »

You just add "Sample=Sample_DeferredShading" manually to samples.cfg. As for screenshots, they're outputed to a "screenshots" folder in the runtime directory of the browser. If you mean thumbnails, then that goes in Samples/Media/thumbnails. Hope that helps. :)
User avatar
xadhoom
Minaton
Posts: 973
Joined: Fri Dec 28, 2007 4:35 pm
Location: Germany
x 1

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by xadhoom »

Hi Omniter!

The dancing Ogre texture does not show up in the appropriate sample in latest trunk. Did I miss something?

BTW: It would be nice to be able to start/resume a sample by with a double click on its thumbnail.

xad
User avatar
omniter
OGRE Contributor
OGRE Contributor
Posts: 424
Joined: Thu Mar 19, 2009 8:08 am
Location: Canada
x 44

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by omniter »

Hey xadhoom.
I think the team is doing some fixes to that particular sample, because I remember sinbad mentioning that it needed some work, so that could be why it's not showing up for you? As for the resuming thing, do you mean you want a way to get out of the pause menu without using the escape key?
User avatar
xadhoom
Minaton
Posts: 973
Joined: Fri Dec 28, 2007 4:35 pm
Location: Germany
x 1

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by xadhoom »

Hmm, actually the workflow could allow that a doubleclick on a sample rectangle does the same like "Start/Continue Sample", couldn´t it?

xad
User avatar
omniter
OGRE Contributor
OGRE Contributor
Posts: 424
Joined: Thu Mar 19, 2009 8:08 am
Location: Canada
x 44

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by omniter »

The only problem with that is detecting double clicks. OIS doesn't support double click detection, so we'd have to hack it ourselves. That'd be troublesome, because double click speeds are system dependent.
User avatar
Noman
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 714
Joined: Mon Jan 31, 2005 7:21 pm
Location: Israel
x 2
Contact:

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by Noman »

Ok... I committed the converted deferred shading sample to trunk. The only thing I didn't take care of yet is the static linking options, which I don't know exactly what I need to add where.

Small note - the screenshots dir doesn't get created automatically by the build system, and screenshots aren't saved unless it exists (the directory does not get created otherwise). I think that the CMake should be changed accordingly.

Some cleanup and maybe a few more minor features will be added soon, but the demo is already functional again...

Compositor demo coming up next :)
User avatar
omniter
OGRE Contributor
OGRE Contributor
Posts: 424
Joined: Thu Mar 19, 2009 8:08 am
Location: Canada
x 44

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by omniter »

Great work, Noman. And congrats on joining the team! :D
User avatar
boyamer
Orc
Posts: 459
Joined: Sat Jan 24, 2009 11:16 am
Location: Italy
x 6

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by boyamer »

I think you should take part of Ogre team too Omniter,your work looks great,congrats on Noman :)
User avatar
omniter
OGRE Contributor
OGRE Contributor
Posts: 424
Joined: Thu Mar 19, 2009 8:08 am
Location: Canada
x 44

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by omniter »

I really would love to, Number One, and the team was kind enough to give me the opportunity, but school demands most of my time and attention right now. :(
On the bright side, the Quick Guide to the OgreBites Samples Framework will be up in the wiki tomorrow. :)
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by sinbad »

omniter wrote:I think the team is doing some fixes to that particular sample, because I remember sinbad mentioning that it needed some work, so that could be why it's not showing up for you?
It's always been blank for me, even in your soc09-samples branch, that's why it was on the list as 'needing more work'. I don't think anyone has changed it so far. What was it supposed to show?
User avatar
omniter
OGRE Contributor
OGRE Contributor
Posts: 424
Joined: Thu Mar 19, 2009 8:08 am
Location: Canada
x 44

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by omniter »

It's supposed to show four planes each with a different texture effect applied to the dancing OGRE sprite. It needs Media/packs/ogredance.zip, which is already listed inside resources.cfg. What is going on right now?
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by masterfalcon »

omniter wrote:It's supposed to show four planes each with a different texture effect applied to the dancing OGRE sprite. It needs Media/packs/ogredance.zip, which is already listed inside resources.cfg. What is going on right now?
Looks like the reference to it was missing in the resources.cfg template file. All fixed!
User avatar
omniter
OGRE Contributor
OGRE Contributor
Posts: 424
Joined: Thu Mar 19, 2009 8:08 am
Location: Canada
x 44

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by omniter »

:D
User avatar
omniter
OGRE Contributor
OGRE Contributor
Posts: 424
Joined: Thu Mar 19, 2009 8:08 am
Location: Canada
x 44

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by omniter »

Alright guys, the Quick Guide to the OgreBites Samples Framework is now up in the wiki. :D The part about the tray manager and camera controller will be up later today. Feel free to proofread/edit it.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by sinbad »

Looks good to me so far, looking forward to the Trays bit :)
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

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by Assaf Raman »

I have a general question for the community - what is main use for the samples in the "Unified Samples Framework & Browser"?
1. Show off OGRE with the best samples possible.
2. Give developers use samples of how to use OGRE.

If 2 is the answer - I think we should add some other samples that exists on the forum, EX: We don't have any sample that shows how to use the stencil buffer.
EX: Once created a sample of stencil use, Should it be add to the sample browser as a new sample?
I have other useful examples of OGRE use samples on the forum and in the playpan.
I think that one of the reasons that we limited that number of samples in the past was that we didn't want so many EXEs - we had an exe for each sample, but now - it will be just a new entry in the sample browser UI.

Bottom line - with the new framework - what makes a sample suitable to be a part of "sample browser"?
Watch out for my OGRE related tweets here.
User avatar
madmarx
OGRE Expert User
OGRE Expert User
Posts: 1671
Joined: Mon Jan 21, 2008 10:26 pm
x 50

Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser

Post by madmarx »

From wiki:
"It is also important to note that while it is technically possible to learn OGRE with the OgreBites framework, doing so is strongly discouraged."
So for tutorial is much more 'no'.
But it's true that code samples are different. I personnaly like code samples. But I have 2 things to say about samples :
1/it could be hard to maintain if there is too much.
2/ Even if there are lots of samples does not mean that they "must" be compiled. For the 'show' of Ogre3D, I think it could be good to keep the most attractive compiled, and for the 'programming sample' the code + cmakefile/vcproj/... + corresponding shaders and scripts only should be enough.

So my point of view is more :
demos => of course; Maybe a category 'Best Demos' or 'Glittering Ogre' in the browser could select the best ones?
samples => might be not compiled (to not burden the demos) ? should they be maintained?
tutorial => no ?

I don't know what the team think about this, but I am reading with interest.
Bottom line - with the new framework - what makes a sample suitable to be a part of "sample browser"?
As a programmer I say anything that is not done everyday but that is usefull for an Ogre user.
Tutorials + Ogre searchable API + more for Ogre1.7 : http://sourceforge.net/projects/so3dtools/
Corresponding thread : http://www.ogre3d.org/forums/viewtopic. ... 93&start=0
Post Reply