Page 13 of 18

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

Posted: Sun Oct 18, 2009 6:47 pm
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.

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

Posted: Sun Oct 18, 2009 8:21 pm
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)

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

Posted: Sun Oct 18, 2009 11:47 pm
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...

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

Posted: Mon Oct 19, 2009 5:11 am
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

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

Posted: Mon Oct 19, 2009 10:46 am
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!

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

Posted: Mon Oct 19, 2009 11:15 am
by omniter
I'll definitely have the article up sometime in the next 3 days. :)

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

Posted: Mon Oct 19, 2009 1:19 pm
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.

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

Posted: Tue Oct 20, 2009 2:55 pm
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.

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

Posted: Tue Oct 20, 2009 3:29 pm
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. :)

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

Posted: Wed Oct 21, 2009 10:25 am
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

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

Posted: Wed Oct 21, 2009 5:01 pm
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?

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

Posted: Wed Oct 21, 2009 10:39 pm
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

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

Posted: Thu Oct 22, 2009 12:13 am
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.

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

Posted: Thu Oct 22, 2009 12:56 am
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 :)

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

Posted: Thu Oct 22, 2009 12:58 am
by omniter
Great work, Noman. And congrats on joining the team! :D

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

Posted: Thu Oct 22, 2009 7:56 am
by boyamer
I think you should take part of Ogre team too Omniter,your work looks great,congrats on Noman :)

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

Posted: Thu Oct 22, 2009 1:43 pm
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. :)

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

Posted: Thu Oct 22, 2009 5:27 pm
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?

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

Posted: Thu Oct 22, 2009 6:00 pm
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?

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

Posted: Fri Oct 23, 2009 12:52 am
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!

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

Posted: Fri Oct 23, 2009 1:03 am
by omniter
:D

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

Posted: Fri Oct 23, 2009 1:12 pm
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.

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

Posted: Fri Oct 23, 2009 6:01 pm
by sinbad
Looks good to me so far, looking forward to the Trays bit :)

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

Posted: Fri Oct 23, 2009 7:35 pm
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"?

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

Posted: Sat Oct 24, 2009 4:10 pm
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.