[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: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 2
Contact:

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

Post by sinbad » Sun Oct 18, 2009 6:47 pm

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.
0 x

User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
Contact:

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

Post by masterfalcon » Sun Oct 18, 2009 8:21 pm

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)
0 x

User avatar
Noman
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 714
Joined: Mon Jan 31, 2005 7:21 pm
Location: Israel
Contact:

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

Post by Noman » Sun Oct 18, 2009 11:47 pm

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...
0 x

User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
Contact:

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

Post by masterfalcon » Mon Oct 19, 2009 5:11 am

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
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 2
Contact:

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

Post by sinbad » Mon Oct 19, 2009 10:46 am

@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!
0 x

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

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

Post by omniter » Mon Oct 19, 2009 11:15 am

I'll definitely have the article up sometime in the next 3 days. :)
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 2
Contact:

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

Post by sinbad » Mon Oct 19, 2009 1:19 pm

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.
0 x

User avatar
Noman
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 714
Joined: Mon Jan 31, 2005 7:21 pm
Location: Israel
Contact:

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

Post by Noman » Tue Oct 20, 2009 2:55 pm

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.
0 x

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

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

Post by omniter » Tue Oct 20, 2009 3:29 pm

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. :)
0 x

User avatar
xadhoom
Minaton
Posts: 973
Joined: Fri Dec 28, 2007 4:35 pm
Location: Germany

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

Post by xadhoom » Wed Oct 21, 2009 10:25 am

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
0 x

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

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

Post by omniter » Wed Oct 21, 2009 5:01 pm

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?
0 x

User avatar
xadhoom
Minaton
Posts: 973
Joined: Fri Dec 28, 2007 4:35 pm
Location: Germany

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

Post by xadhoom » Wed Oct 21, 2009 10:39 pm

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

xad
0 x

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

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

Post by omniter » Thu Oct 22, 2009 12:13 am

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.
0 x

User avatar
Noman
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 714
Joined: Mon Jan 31, 2005 7:21 pm
Location: Israel
Contact:

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

Post by Noman » Thu Oct 22, 2009 12:56 am

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 :)
0 x

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

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

Post by omniter » Thu Oct 22, 2009 12:58 am

Great work, Noman. And congrats on joining the team! :D
0 x

User avatar
boyamer
Orc
Posts: 459
Joined: Sat Jan 24, 2009 11:16 am
Location: Italy

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

Post by boyamer » Thu Oct 22, 2009 7:56 am

I think you should take part of Ogre team too Omniter,your work looks great,congrats on Noman :)
0 x

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

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

Post by omniter » Thu Oct 22, 2009 1:43 pm

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. :)
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 2
Contact:

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

Post by sinbad » Thu Oct 22, 2009 5:27 pm

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?
0 x

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

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

Post by omniter » Thu Oct 22, 2009 6:00 pm

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?
0 x

User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
Contact:

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

Post by masterfalcon » Fri Oct 23, 2009 12:52 am

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!
0 x

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

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

Post by omniter » Fri Oct 23, 2009 1:03 am

:D
0 x

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

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

Post by omniter » Fri Oct 23, 2009 1:12 pm

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.
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 2
Contact:

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

Post by sinbad » Fri Oct 23, 2009 6:01 pm

Looks good to me so far, looking forward to the Trays bit :)
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

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

Post by Assaf Raman » Fri Oct 23, 2009 7:35 pm

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"?
0 x
Watch out for my OGRE related tweets here.

User avatar
madmarx
OGRE Expert User
OGRE Expert User
Posts: 1669
Joined: Mon Jan 21, 2008 10:26 pm

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

Post by madmarx » Sat Oct 24, 2009 4:10 pm

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.
0 x
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