├── Makefile
├── Project.xcconfig
├── README.md
├── bin
└── data
│ ├── advect.vert
│ ├── curl.frag
│ ├── curl.vert
│ └── gui.ctls.xml
├── config.make
├── gpu curl 2D.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── peterw.xcuserdatad
│ │ ├── UserInterfaceState.xcuserstate
│ │ └── WorkspaceSettings.xcsettings
├── xcshareddata
│ └── xcschemes
│ │ ├── emptyExample Debug.xcscheme
│ │ └── emptyExample Release.xcscheme
└── xcuserdata
│ └── peterw.xcuserdatad
│ └── xcschemes
│ └── xcschememanagement.plist
├── openFrameworks-Info.plist
└── src
├── OctaveNoise.cpp
├── OctaveNoise.h
├── main.cpp
├── testApp.cpp
└── testApp.h
/Makefile:
--------------------------------------------------------------------------------
1 | # Attempt to load a config.make file.
2 | # If none is found, project defaults in config.project.make will be used.
3 | ifneq ($(wildcard config.make),)
4 | include config.make
5 | endif
6 |
7 | # make sure the the OF_ROOT location is defined
8 | ifndef OF_ROOT
9 | OF_ROOT=../../..
10 | endif
11 |
12 | # call the project makefile!
13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk
14 |
--------------------------------------------------------------------------------
/Project.xcconfig:
--------------------------------------------------------------------------------
1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT.
2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED
3 | OF_PATH = ../../..
4 |
5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE
6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig"
7 |
8 | //ICONS - NEW IN 0072
9 | ICON_NAME_DEBUG = icon-debug.icns
10 | ICON_NAME_RELEASE = icon.icns
11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/
12 |
13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to:
14 | //ICON_FILE_PATH = bin/data/
15 |
16 | OTHER_LDFLAGS = $(OF_CORE_LIBS)
17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS)
18 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # gpu-curl-2d
2 |
3 | A simple example of curl noise in 2D
4 |
5 | For more info please see here http://petewerner.blogspot.com.au/2015/02/intro-to-curl-noise.html
6 |
--------------------------------------------------------------------------------
/bin/data/advect.vert:
--------------------------------------------------------------------------------
1 | #version 330
2 |
3 | in vec2 Position;
4 | out vec2 vPosition;
5 |
6 | uniform sampler2D Sampler;
7 | uniform float Time;
8 | const float UINT_MAX = 4294967295.0;
9 |
10 | uniform vec2 dims;
11 |
12 | uniform float curlamt;
13 | uniform vec2 constVel;
14 | uniform float advectDt;
15 |
16 | uint randhash(uint seed)
17 | {
18 | uint i=(seed^12345391u)*2654435769u;
19 | i^=(i<<6u)^(i>>26u);
20 | i*=2654435769u;
21 | i+=(i<<5u)^(i>>12u);
22 | return i;
23 | }
24 |
25 | float randhashf(uint seed, float b)
26 | {
27 | return float(b * randhash(seed)) / UINT_MAX;
28 | }
29 |
30 | vec2 SampleVelocity2D(vec2 p)
31 | {
32 | vec2 loc = p.xy;
33 | vec3 v = texture(Sampler, loc).rgb;
34 | return vec2(v.r, v.b);
35 | }
36 |
37 | void main()
38 | {
39 | vPosition = Position;
40 |
41 | vec2 loc = Position.xy / dims;
42 |
43 | vec2 curlvel = SampleVelocity2D(loc.st);
44 |
45 | vPosition.xy += (constVel + curlvel * curlamt) * advectDt;
46 |
47 | if (Position.y > dims.y || Position.y < 1 || Position.x > dims.x || Position.x < 1) {
48 | uint seed = uint(Time * 1000.0) + uint(gl_VertexID);
49 | vPosition.x = randhashf(seed++, dims.x);
50 | vPosition.y = randhashf(seed++, dims.y);
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/bin/data/curl.frag:
--------------------------------------------------------------------------------
1 | #version 330
2 |
3 | out vec4 FragColor;
4 | uniform sampler2D uPtex;
5 | uniform vec2 dims;
6 |
7 | vec2
8 | Grad(float x, float y)
9 | {
10 | float eps = 1.0/dims.x;
11 | float h = 1.0/dims.x * 0.5;
12 |
13 | float n1, n2, dx, dy;
14 | vec2 dx0, dx1, dy0, dy1;
15 | dx0 = vec2(x - eps, y);
16 | dx1 = vec2(x + eps, y);
17 | dy0 = vec2(x, y - eps);
18 | dy1 = vec2(x, y + eps);
19 |
20 | n1 = texture(uPtex, dx0 + h).r;
21 | n2 = texture(uPtex, dx1 + h).r;
22 | dx = n1 - n2;
23 |
24 | n1 = texture(uPtex, dy0 + h).r;
25 | n2 = texture(uPtex, dy1 + h).r;
26 | dy = n1 - n2;
27 |
28 | vec2 g = vec2(dx, dy) * 10.0f;
29 | return g;
30 | }
31 |
32 |
33 | vec2
34 | Curl(float x, float y)
35 | {
36 | vec2 g = Grad(x, y);
37 | return vec2(g.y, -g.x);
38 | }
39 |
40 | void
41 | main()
42 | {
43 | vec2 loc = gl_FragCoord.xy;
44 | loc /= dims;
45 |
46 | vec2 g = Curl(loc.s, loc.t);
47 | //i use the blue channel just cause I like blue more than green
48 | FragColor = vec4(g.x, 0.0, g.y, 1.0);
49 |
50 | }
--------------------------------------------------------------------------------
/bin/data/curl.vert:
--------------------------------------------------------------------------------
1 | #version 330
2 |
3 | uniform mat4 modelViewProjectionMatrix;
4 | in vec4 position;
5 |
6 | void
7 | main()
8 | {
9 | gl_Position = modelViewProjectionMatrix * position;
10 | }
--------------------------------------------------------------------------------
/bin/data/gui.ctls.xml:
--------------------------------------------------------------------------------
1 |
2 | 3
3 | 4.5635
4 | 2.944
5 | 0
6 | -1.22
7 | 1
8 | 0.99
9 | 0
10 | 0
11 | 0.345
12 | 1
13 |
14 |
15 |
--------------------------------------------------------------------------------
/config.make:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # CONFIGURE PROJECT MAKEFILE (optional)
3 | # This file is where we make project specific configurations.
4 | ################################################################################
5 |
6 | ################################################################################
7 | # OF ROOT
8 | # The location of your root openFrameworks installation
9 | # (default) OF_ROOT = ../../..
10 | ################################################################################
11 | # OF_ROOT = ../../..
12 |
13 | ################################################################################
14 | # PROJECT ROOT
15 | # The location of the project - a starting place for searching for files
16 | # (default) PROJECT_ROOT = . (this directory)
17 | #
18 | ################################################################################
19 | # PROJECT_ROOT = .
20 |
21 | ################################################################################
22 | # PROJECT SPECIFIC CHECKS
23 | # This is a project defined section to create internal makefile flags to
24 | # conditionally enable or disable the addition of various features within
25 | # this makefile. For instance, if you want to make changes based on whether
26 | # GTK is installed, one might test that here and create a variable to check.
27 | ################################################################################
28 | # None
29 |
30 | ################################################################################
31 | # PROJECT EXTERNAL SOURCE PATHS
32 | # These are fully qualified paths that are not within the PROJECT_ROOT folder.
33 | # Like source folders in the PROJECT_ROOT, these paths are subject to
34 | # exlclusion via the PROJECT_EXLCUSIONS list.
35 | #
36 | # (default) PROJECT_EXTERNAL_SOURCE_PATHS = (blank)
37 | #
38 | # Note: Leave a leading space when adding list items with the += operator
39 | ################################################################################
40 | # PROJECT_EXTERNAL_SOURCE_PATHS =
41 |
42 | ################################################################################
43 | # PROJECT EXCLUSIONS
44 | # These makefiles assume that all folders in your current project directory
45 | # and any listed in the PROJECT_EXTERNAL_SOURCH_PATHS are are valid locations
46 | # to look for source code. The any folders or files that match any of the
47 | # items in the PROJECT_EXCLUSIONS list below will be ignored.
48 | #
49 | # Each item in the PROJECT_EXCLUSIONS list will be treated as a complete
50 | # string unless teh user adds a wildcard (%) operator to match subdirectories.
51 | # GNU make only allows one wildcard for matching. The second wildcard (%) is
52 | # treated literally.
53 | #
54 | # (default) PROJECT_EXCLUSIONS = (blank)
55 | #
56 | # Will automatically exclude the following:
57 | #
58 | # $(PROJECT_ROOT)/bin%
59 | # $(PROJECT_ROOT)/obj%
60 | # $(PROJECT_ROOT)/%.xcodeproj
61 | #
62 | # Note: Leave a leading space when adding list items with the += operator
63 | ################################################################################
64 | # PROJECT_EXCLUSIONS =
65 |
66 | ################################################################################
67 | # PROJECT LINKER FLAGS
68 | # These flags will be sent to the linker when compiling the executable.
69 | #
70 | # (default) PROJECT_LDFLAGS = -Wl,-rpath=./libs
71 | #
72 | # Note: Leave a leading space when adding list items with the += operator
73 | ################################################################################
74 |
75 | # Currently, shared libraries that are needed are copied to the
76 | # $(PROJECT_ROOT)/bin/libs directory. The following LDFLAGS tell the linker to
77 | # add a runtime path to search for those shared libraries, since they aren't
78 | # incorporated directly into the final executable application binary.
79 | # TODO: should this be a default setting?
80 | # PROJECT_LDFLAGS=-Wl,-rpath=./libs
81 |
82 | ################################################################################
83 | # PROJECT DEFINES
84 | # Create a space-delimited list of DEFINES. The list will be converted into
85 | # CFLAGS with the "-D" flag later in the makefile.
86 | #
87 | # (default) PROJECT_DEFINES = (blank)
88 | #
89 | # Note: Leave a leading space when adding list items with the += operator
90 | ################################################################################
91 | # PROJECT_DEFINES =
92 |
93 | ################################################################################
94 | # PROJECT CFLAGS
95 | # This is a list of fully qualified CFLAGS required when compiling for this
96 | # project. These CFLAGS will be used IN ADDITION TO the PLATFORM_CFLAGS
97 | # defined in your platform specific core configuration files. These flags are
98 | # presented to the compiler BEFORE the PROJECT_OPTIMIZATION_CFLAGS below.
99 | #
100 | # (default) PROJECT_CFLAGS = (blank)
101 | #
102 | # Note: Before adding PROJECT_CFLAGS, note that the PLATFORM_CFLAGS defined in
103 | # your platform specific configuration file will be applied by default and
104 | # further flags here may not be needed.
105 | #
106 | # Note: Leave a leading space when adding list items with the += operator
107 | ################################################################################
108 | # PROJECT_CFLAGS =
109 |
110 | ################################################################################
111 | # PROJECT OPTIMIZATION CFLAGS
112 | # These are lists of CFLAGS that are target-specific. While any flags could
113 | # be conditionally added, they are usually limited to optimization flags.
114 | # These flags are added BEFORE the PROJECT_CFLAGS.
115 | #
116 | # PROJECT_OPTIMIZATION_CFLAGS_RELEASE flags are only applied to RELEASE targets.
117 | #
118 | # (default) PROJECT_OPTIMIZATION_CFLAGS_RELEASE = (blank)
119 | #
120 | # PROJECT_OPTIMIZATION_CFLAGS_DEBUG flags are only applied to DEBUG targets.
121 | #
122 | # (default) PROJECT_OPTIMIZATION_CFLAGS_DEBUG = (blank)
123 | #
124 | # Note: Before adding PROJECT_OPTIMIZATION_CFLAGS, please note that the
125 | # PLATFORM_OPTIMIZATION_CFLAGS defined in your platform specific configuration
126 | # file will be applied by default and further optimization flags here may not
127 | # be needed.
128 | #
129 | # Note: Leave a leading space when adding list items with the += operator
130 | ################################################################################
131 | # PROJECT_OPTIMIZATION_CFLAGS_RELEASE =
132 | # PROJECT_OPTIMIZATION_CFLAGS_DEBUG =
133 |
134 | ################################################################################
135 | # PROJECT COMPILERS
136 | # Custom compilers can be set for CC and CXX
137 | # (default) PROJECT_CXX = (blank)
138 | # (default) PROJECT_CC = (blank)
139 | # Note: Leave a leading space when adding list items with the += operator
140 | ################################################################################
141 | # PROJECT_CXX =
142 | # PROJECT_CC =
143 |
--------------------------------------------------------------------------------
/gpu curl 2D.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | BBAB23CB13894F3D00AA2426 /* GLUT.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = BBAB23BE13894E4700AA2426 /* GLUT.framework */; };
11 | E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4328148138ABC890047C5CB /* openFrameworksDebug.a */; };
12 | E45BE97B0E8CC7DD009D7055 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9710E8CC7DD009D7055 /* AGL.framework */; };
13 | E45BE97C0E8CC7DD009D7055 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */; };
14 | E45BE97D0E8CC7DD009D7055 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */; };
15 | E45BE97E0E8CC7DD009D7055 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9740E8CC7DD009D7055 /* Carbon.framework */; };
16 | E45BE97F0E8CC7DD009D7055 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */; };
17 | E45BE9800E8CC7DD009D7055 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */; };
18 | E45BE9810E8CC7DD009D7055 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9770E8CC7DD009D7055 /* CoreServices.framework */; };
19 | E45BE9830E8CC7DD009D7055 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9790E8CC7DD009D7055 /* OpenGL.framework */; };
20 | E45BE9840E8CC7DD009D7055 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */; };
21 | E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1D0A3A1BDC003C02F2 /* main.cpp */; };
22 | E4B69E210A3A1BDC003C02F2 /* testApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */; };
23 | E4C2424710CC5A17004149E2 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424410CC5A17004149E2 /* AppKit.framework */; };
24 | E4C2424810CC5A17004149E2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424510CC5A17004149E2 /* Cocoa.framework */; };
25 | E4C2424910CC5A17004149E2 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424610CC5A17004149E2 /* IOKit.framework */; };
26 | E4EB6799138ADC1D00A09F29 /* GLUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BBAB23BE13894E4700AA2426 /* GLUT.framework */; };
27 | E7E077E515D3B63C0020DFD4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */; };
28 | E7E077E815D3B6510020DFD4 /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E077E715D3B6510020DFD4 /* QTKit.framework */; };
29 | E7F985F815E0DEA3003869B5 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7F985F515E0DE99003869B5 /* Accelerate.framework */; };
30 | FC4274611A707A77003DC63A /* ofxBaseGui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC4274501A707A77003DC63A /* ofxBaseGui.cpp */; };
31 | FC4274621A707A77003DC63A /* ofxButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC4274521A707A77003DC63A /* ofxButton.cpp */; };
32 | FC4274631A707A77003DC63A /* ofxGuiGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC4274551A707A77003DC63A /* ofxGuiGroup.cpp */; };
33 | FC4274641A707A77003DC63A /* ofxLabel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC4274571A707A77003DC63A /* ofxLabel.cpp */; };
34 | FC4274651A707A77003DC63A /* ofxPanel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC4274591A707A77003DC63A /* ofxPanel.cpp */; };
35 | FC4274661A707A77003DC63A /* ofxSlider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC42745B1A707A77003DC63A /* ofxSlider.cpp */; };
36 | FC4274671A707A77003DC63A /* ofxSliderGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC42745D1A707A77003DC63A /* ofxSliderGroup.cpp */; };
37 | FC4274681A707A77003DC63A /* ofxToggle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC42745F1A707A77003DC63A /* ofxToggle.cpp */; };
38 | FC865BBD1A81C377002788C0 /* OctaveNoise.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC865BBB1A81C377002788C0 /* OctaveNoise.cpp */; };
39 | /* End PBXBuildFile section */
40 |
41 | /* Begin PBXContainerItemProxy section */
42 | E4328147138ABC890047C5CB /* PBXContainerItemProxy */ = {
43 | isa = PBXContainerItemProxy;
44 | containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */;
45 | proxyType = 2;
46 | remoteGlobalIDString = E4B27C1510CBEB8E00536013;
47 | remoteInfo = openFrameworks;
48 | };
49 | E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */ = {
50 | isa = PBXContainerItemProxy;
51 | containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */;
52 | proxyType = 1;
53 | remoteGlobalIDString = E4B27C1410CBEB8E00536013;
54 | remoteInfo = openFrameworks;
55 | };
56 | /* End PBXContainerItemProxy section */
57 |
58 | /* Begin PBXCopyFilesBuildPhase section */
59 | E4C2427710CC5ABF004149E2 /* CopyFiles */ = {
60 | isa = PBXCopyFilesBuildPhase;
61 | buildActionMask = 2147483647;
62 | dstPath = "";
63 | dstSubfolderSpec = 10;
64 | files = (
65 | BBAB23CB13894F3D00AA2426 /* GLUT.framework in CopyFiles */,
66 | );
67 | runOnlyForDeploymentPostprocessing = 0;
68 | };
69 | /* End PBXCopyFilesBuildPhase section */
70 |
71 | /* Begin PBXFileReference section */
72 | BBAB23BE13894E4700AA2426 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = ../../../libs/glut/lib/osx/GLUT.framework; sourceTree = ""; };
73 | E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openFrameworksLib.xcodeproj; path = ../../../libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj; sourceTree = SOURCE_ROOT; };
74 | E45BE9710E8CC7DD009D7055 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = ""; };
75 | E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; };
76 | E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; };
77 | E45BE9740E8CC7DD009D7055 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; };
78 | E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; };
79 | E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; };
80 | E45BE9770E8CC7DD009D7055 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = ""; };
81 | E45BE9790E8CC7DD009D7055 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; };
82 | E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; };
83 | E4B69B5B0A3A1756003C02F2 /* gpu curl 2DDebug.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "gpu curl 2DDebug.app"; sourceTree = BUILT_PRODUCTS_DIR; };
84 | E4B69E1D0A3A1BDC003C02F2 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = src/main.cpp; sourceTree = SOURCE_ROOT; };
85 | E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = testApp.cpp; path = src/testApp.cpp; sourceTree = SOURCE_ROOT; };
86 | E4B69E1F0A3A1BDC003C02F2 /* testApp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = testApp.h; path = src/testApp.h; sourceTree = SOURCE_ROOT; };
87 | E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "openFrameworks-Info.plist"; sourceTree = ""; };
88 | E4C2424410CC5A17004149E2 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; };
89 | E4C2424510CC5A17004149E2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; };
90 | E4C2424610CC5A17004149E2 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; };
91 | E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CoreOF.xcconfig; path = ../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig; sourceTree = SOURCE_ROOT; };
92 | E4EB6923138AFD0F00A09F29 /* Project.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Project.xcconfig; sourceTree = ""; };
93 | E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = /System/Library/Frameworks/CoreVideo.framework; sourceTree = ""; };
94 | E7E077E715D3B6510020DFD4 /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = ""; };
95 | E7F985F515E0DE99003869B5 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = /System/Library/Frameworks/Accelerate.framework; sourceTree = ""; };
96 | FC4274501A707A77003DC63A /* ofxBaseGui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxBaseGui.cpp; sourceTree = ""; };
97 | FC4274511A707A77003DC63A /* ofxBaseGui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxBaseGui.h; sourceTree = ""; };
98 | FC4274521A707A77003DC63A /* ofxButton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxButton.cpp; sourceTree = ""; };
99 | FC4274531A707A77003DC63A /* ofxButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxButton.h; sourceTree = ""; };
100 | FC4274541A707A77003DC63A /* ofxGui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxGui.h; sourceTree = ""; };
101 | FC4274551A707A77003DC63A /* ofxGuiGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxGuiGroup.cpp; sourceTree = ""; };
102 | FC4274561A707A77003DC63A /* ofxGuiGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxGuiGroup.h; sourceTree = ""; };
103 | FC4274571A707A77003DC63A /* ofxLabel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxLabel.cpp; sourceTree = ""; };
104 | FC4274581A707A77003DC63A /* ofxLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxLabel.h; sourceTree = ""; };
105 | FC4274591A707A77003DC63A /* ofxPanel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxPanel.cpp; sourceTree = ""; };
106 | FC42745A1A707A77003DC63A /* ofxPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxPanel.h; sourceTree = ""; };
107 | FC42745B1A707A77003DC63A /* ofxSlider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxSlider.cpp; sourceTree = ""; };
108 | FC42745C1A707A77003DC63A /* ofxSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxSlider.h; sourceTree = ""; };
109 | FC42745D1A707A77003DC63A /* ofxSliderGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxSliderGroup.cpp; sourceTree = ""; };
110 | FC42745E1A707A77003DC63A /* ofxSliderGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxSliderGroup.h; sourceTree = ""; };
111 | FC42745F1A707A77003DC63A /* ofxToggle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxToggle.cpp; sourceTree = ""; };
112 | FC4274601A707A77003DC63A /* ofxToggle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxToggle.h; sourceTree = ""; };
113 | FC865BBB1A81C377002788C0 /* OctaveNoise.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OctaveNoise.cpp; sourceTree = ""; };
114 | FC865BBC1A81C377002788C0 /* OctaveNoise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OctaveNoise.h; sourceTree = ""; };
115 | FC865BBE1A81CA6C002788C0 /* curl.vert */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; name = curl.vert; path = bin/data/curl.vert; sourceTree = SOURCE_ROOT; };
116 | FC865BBF1A81CA7C002788C0 /* curl.frag */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; name = curl.frag; path = bin/data/curl.frag; sourceTree = SOURCE_ROOT; };
117 | FC865BC11A81D3B4002788C0 /* advect.vert */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; name = advect.vert; path = bin/data/advect.vert; sourceTree = SOURCE_ROOT; };
118 | /* End PBXFileReference section */
119 |
120 | /* Begin PBXFrameworksBuildPhase section */
121 | E4B69B590A3A1756003C02F2 /* Frameworks */ = {
122 | isa = PBXFrameworksBuildPhase;
123 | buildActionMask = 2147483647;
124 | files = (
125 | E7F985F815E0DEA3003869B5 /* Accelerate.framework in Frameworks */,
126 | E7E077E815D3B6510020DFD4 /* QTKit.framework in Frameworks */,
127 | E4EB6799138ADC1D00A09F29 /* GLUT.framework in Frameworks */,
128 | E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */,
129 | E45BE97B0E8CC7DD009D7055 /* AGL.framework in Frameworks */,
130 | E45BE97C0E8CC7DD009D7055 /* ApplicationServices.framework in Frameworks */,
131 | E45BE97D0E8CC7DD009D7055 /* AudioToolbox.framework in Frameworks */,
132 | E45BE97E0E8CC7DD009D7055 /* Carbon.framework in Frameworks */,
133 | E45BE97F0E8CC7DD009D7055 /* CoreAudio.framework in Frameworks */,
134 | E45BE9800E8CC7DD009D7055 /* CoreFoundation.framework in Frameworks */,
135 | E45BE9810E8CC7DD009D7055 /* CoreServices.framework in Frameworks */,
136 | E45BE9830E8CC7DD009D7055 /* OpenGL.framework in Frameworks */,
137 | E45BE9840E8CC7DD009D7055 /* QuickTime.framework in Frameworks */,
138 | E4C2424710CC5A17004149E2 /* AppKit.framework in Frameworks */,
139 | E4C2424810CC5A17004149E2 /* Cocoa.framework in Frameworks */,
140 | E4C2424910CC5A17004149E2 /* IOKit.framework in Frameworks */,
141 | E7E077E515D3B63C0020DFD4 /* CoreVideo.framework in Frameworks */,
142 | );
143 | runOnlyForDeploymentPostprocessing = 0;
144 | };
145 | /* End PBXFrameworksBuildPhase section */
146 |
147 | /* Begin PBXGroup section */
148 | BB4B014C10F69532006C3DED /* addons */ = {
149 | isa = PBXGroup;
150 | children = (
151 | FC42744E1A707A77003DC63A /* ofxGui */,
152 | );
153 | name = addons;
154 | sourceTree = "";
155 | };
156 | BBAB23C913894ECA00AA2426 /* system frameworks */ = {
157 | isa = PBXGroup;
158 | children = (
159 | E7F985F515E0DE99003869B5 /* Accelerate.framework */,
160 | E4C2424410CC5A17004149E2 /* AppKit.framework */,
161 | E4C2424510CC5A17004149E2 /* Cocoa.framework */,
162 | E4C2424610CC5A17004149E2 /* IOKit.framework */,
163 | E45BE9710E8CC7DD009D7055 /* AGL.framework */,
164 | E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */,
165 | E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */,
166 | E45BE9740E8CC7DD009D7055 /* Carbon.framework */,
167 | E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */,
168 | E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */,
169 | E45BE9770E8CC7DD009D7055 /* CoreServices.framework */,
170 | E45BE9790E8CC7DD009D7055 /* OpenGL.framework */,
171 | E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */,
172 | E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */,
173 | E7E077E715D3B6510020DFD4 /* QTKit.framework */,
174 | );
175 | name = "system frameworks";
176 | sourceTree = "";
177 | };
178 | BBAB23CA13894EDB00AA2426 /* 3rd party frameworks */ = {
179 | isa = PBXGroup;
180 | children = (
181 | BBAB23BE13894E4700AA2426 /* GLUT.framework */,
182 | );
183 | name = "3rd party frameworks";
184 | sourceTree = "";
185 | };
186 | E4328144138ABC890047C5CB /* Products */ = {
187 | isa = PBXGroup;
188 | children = (
189 | E4328148138ABC890047C5CB /* openFrameworksDebug.a */,
190 | );
191 | name = Products;
192 | sourceTree = "";
193 | };
194 | E45BE5980E8CC70C009D7055 /* frameworks */ = {
195 | isa = PBXGroup;
196 | children = (
197 | BBAB23CA13894EDB00AA2426 /* 3rd party frameworks */,
198 | BBAB23C913894ECA00AA2426 /* system frameworks */,
199 | );
200 | name = frameworks;
201 | sourceTree = "";
202 | };
203 | E4B69B4A0A3A1720003C02F2 = {
204 | isa = PBXGroup;
205 | children = (
206 | E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */,
207 | E4EB6923138AFD0F00A09F29 /* Project.xcconfig */,
208 | E4B69E1C0A3A1BDC003C02F2 /* src */,
209 | E4EEC9E9138DF44700A80321 /* openFrameworks */,
210 | BB4B014C10F69532006C3DED /* addons */,
211 | E45BE5980E8CC70C009D7055 /* frameworks */,
212 | E4B69B5B0A3A1756003C02F2 /* gpu curl 2DDebug.app */,
213 | );
214 | sourceTree = "";
215 | };
216 | E4B69E1C0A3A1BDC003C02F2 /* src */ = {
217 | isa = PBXGroup;
218 | children = (
219 | E4B69E1D0A3A1BDC003C02F2 /* main.cpp */,
220 | E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */,
221 | E4B69E1F0A3A1BDC003C02F2 /* testApp.h */,
222 | FC865BBB1A81C377002788C0 /* OctaveNoise.cpp */,
223 | FC865BBC1A81C377002788C0 /* OctaveNoise.h */,
224 | FC865BC11A81D3B4002788C0 /* advect.vert */,
225 | FC865BBE1A81CA6C002788C0 /* curl.vert */,
226 | FC865BBF1A81CA7C002788C0 /* curl.frag */,
227 | );
228 | path = src;
229 | sourceTree = SOURCE_ROOT;
230 | };
231 | E4EEC9E9138DF44700A80321 /* openFrameworks */ = {
232 | isa = PBXGroup;
233 | children = (
234 | E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */,
235 | E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */,
236 | );
237 | name = openFrameworks;
238 | sourceTree = "";
239 | };
240 | FC42744E1A707A77003DC63A /* ofxGui */ = {
241 | isa = PBXGroup;
242 | children = (
243 | FC42744F1A707A77003DC63A /* src */,
244 | );
245 | name = ofxGui;
246 | path = ../../../addons/ofxGui;
247 | sourceTree = "";
248 | };
249 | FC42744F1A707A77003DC63A /* src */ = {
250 | isa = PBXGroup;
251 | children = (
252 | FC4274501A707A77003DC63A /* ofxBaseGui.cpp */,
253 | FC4274511A707A77003DC63A /* ofxBaseGui.h */,
254 | FC4274521A707A77003DC63A /* ofxButton.cpp */,
255 | FC4274531A707A77003DC63A /* ofxButton.h */,
256 | FC4274541A707A77003DC63A /* ofxGui.h */,
257 | FC4274551A707A77003DC63A /* ofxGuiGroup.cpp */,
258 | FC4274561A707A77003DC63A /* ofxGuiGroup.h */,
259 | FC4274571A707A77003DC63A /* ofxLabel.cpp */,
260 | FC4274581A707A77003DC63A /* ofxLabel.h */,
261 | FC4274591A707A77003DC63A /* ofxPanel.cpp */,
262 | FC42745A1A707A77003DC63A /* ofxPanel.h */,
263 | FC42745B1A707A77003DC63A /* ofxSlider.cpp */,
264 | FC42745C1A707A77003DC63A /* ofxSlider.h */,
265 | FC42745D1A707A77003DC63A /* ofxSliderGroup.cpp */,
266 | FC42745E1A707A77003DC63A /* ofxSliderGroup.h */,
267 | FC42745F1A707A77003DC63A /* ofxToggle.cpp */,
268 | FC4274601A707A77003DC63A /* ofxToggle.h */,
269 | );
270 | path = src;
271 | sourceTree = "";
272 | };
273 | /* End PBXGroup section */
274 |
275 | /* Begin PBXNativeTarget section */
276 | E4B69B5A0A3A1756003C02F2 /* gpu curl 2D */ = {
277 | isa = PBXNativeTarget;
278 | buildConfigurationList = E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "gpu curl 2D" */;
279 | buildPhases = (
280 | E4B69B580A3A1756003C02F2 /* Sources */,
281 | E4B69B590A3A1756003C02F2 /* Frameworks */,
282 | E4B6FFFD0C3F9AB9008CF71C /* ShellScript */,
283 | E4C2427710CC5ABF004149E2 /* CopyFiles */,
284 | );
285 | buildRules = (
286 | );
287 | dependencies = (
288 | E4EEB9AC138B136A00A80321 /* PBXTargetDependency */,
289 | );
290 | name = "gpu curl 2D";
291 | productName = myOFApp;
292 | productReference = E4B69B5B0A3A1756003C02F2 /* gpu curl 2DDebug.app */;
293 | productType = "com.apple.product-type.application";
294 | };
295 | /* End PBXNativeTarget section */
296 |
297 | /* Begin PBXProject section */
298 | E4B69B4C0A3A1720003C02F2 /* Project object */ = {
299 | isa = PBXProject;
300 | attributes = {
301 | LastUpgradeCheck = 0460;
302 | };
303 | buildConfigurationList = E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "gpu curl 2D" */;
304 | compatibilityVersion = "Xcode 3.2";
305 | developmentRegion = English;
306 | hasScannedForEncodings = 0;
307 | knownRegions = (
308 | English,
309 | Japanese,
310 | French,
311 | German,
312 | );
313 | mainGroup = E4B69B4A0A3A1720003C02F2;
314 | productRefGroup = E4B69B4A0A3A1720003C02F2;
315 | projectDirPath = "";
316 | projectReferences = (
317 | {
318 | ProductGroup = E4328144138ABC890047C5CB /* Products */;
319 | ProjectRef = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */;
320 | },
321 | );
322 | projectRoot = "";
323 | targets = (
324 | E4B69B5A0A3A1756003C02F2 /* gpu curl 2D */,
325 | );
326 | };
327 | /* End PBXProject section */
328 |
329 | /* Begin PBXReferenceProxy section */
330 | E4328148138ABC890047C5CB /* openFrameworksDebug.a */ = {
331 | isa = PBXReferenceProxy;
332 | fileType = archive.ar;
333 | path = openFrameworksDebug.a;
334 | remoteRef = E4328147138ABC890047C5CB /* PBXContainerItemProxy */;
335 | sourceTree = BUILT_PRODUCTS_DIR;
336 | };
337 | /* End PBXReferenceProxy section */
338 |
339 | /* Begin PBXShellScriptBuildPhase section */
340 | E4B6FFFD0C3F9AB9008CF71C /* ShellScript */ = {
341 | isa = PBXShellScriptBuildPhase;
342 | buildActionMask = 2147483647;
343 | files = (
344 | );
345 | inputPaths = (
346 | );
347 | outputPaths = (
348 | );
349 | runOnlyForDeploymentPostprocessing = 0;
350 | shellPath = /bin/sh;
351 | shellScript = "cp -f ../../../libs/fmodex/lib/osx/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libfmodex.dylib\"; install_name_tool -change ./libfmodex.dylib @executable_path/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\";\nmkdir -p \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\ncp -f \"$ICON_FILE\" \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\n";
352 | };
353 | /* End PBXShellScriptBuildPhase section */
354 |
355 | /* Begin PBXSourcesBuildPhase section */
356 | E4B69B580A3A1756003C02F2 /* Sources */ = {
357 | isa = PBXSourcesBuildPhase;
358 | buildActionMask = 2147483647;
359 | files = (
360 | FC4274641A707A77003DC63A /* ofxLabel.cpp in Sources */,
361 | E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */,
362 | FC4274611A707A77003DC63A /* ofxBaseGui.cpp in Sources */,
363 | E4B69E210A3A1BDC003C02F2 /* testApp.cpp in Sources */,
364 | FC4274651A707A77003DC63A /* ofxPanel.cpp in Sources */,
365 | FC4274621A707A77003DC63A /* ofxButton.cpp in Sources */,
366 | FC4274661A707A77003DC63A /* ofxSlider.cpp in Sources */,
367 | FC865BBD1A81C377002788C0 /* OctaveNoise.cpp in Sources */,
368 | FC4274681A707A77003DC63A /* ofxToggle.cpp in Sources */,
369 | FC4274671A707A77003DC63A /* ofxSliderGroup.cpp in Sources */,
370 | FC4274631A707A77003DC63A /* ofxGuiGroup.cpp in Sources */,
371 | );
372 | runOnlyForDeploymentPostprocessing = 0;
373 | };
374 | /* End PBXSourcesBuildPhase section */
375 |
376 | /* Begin PBXTargetDependency section */
377 | E4EEB9AC138B136A00A80321 /* PBXTargetDependency */ = {
378 | isa = PBXTargetDependency;
379 | name = openFrameworks;
380 | targetProxy = E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */;
381 | };
382 | /* End PBXTargetDependency section */
383 |
384 | /* Begin XCBuildConfiguration section */
385 | E4B69B4E0A3A1720003C02F2 /* Debug */ = {
386 | isa = XCBuildConfiguration;
387 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */;
388 | buildSettings = {
389 | ARCHS = "$(NATIVE_ARCH)";
390 | CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/";
391 | COPY_PHASE_STRIP = NO;
392 | DEAD_CODE_STRIPPING = YES;
393 | GCC_AUTO_VECTORIZATION = YES;
394 | GCC_ENABLE_SSE3_EXTENSIONS = YES;
395 | GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES;
396 | GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
397 | GCC_OPTIMIZATION_LEVEL = 0;
398 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
399 | GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES;
400 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO;
401 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO;
402 | GCC_WARN_UNINITIALIZED_AUTOS = NO;
403 | GCC_WARN_UNUSED_VALUE = NO;
404 | GCC_WARN_UNUSED_VARIABLE = NO;
405 | HEADER_SEARCH_PATHS = (
406 | "$(OF_CORE_HEADERS)",
407 | src,
408 | );
409 | MACOSX_DEPLOYMENT_TARGET = 10.6;
410 | OTHER_CPLUSPLUSFLAGS = (
411 | "-D__MACOSX_CORE__",
412 | "-lpthread",
413 | "-mtune=native",
414 | );
415 | SDKROOT = macosx;
416 | };
417 | name = Debug;
418 | };
419 | E4B69B4F0A3A1720003C02F2 /* Release */ = {
420 | isa = XCBuildConfiguration;
421 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */;
422 | buildSettings = {
423 | ARCHS = "$(NATIVE_ARCH)";
424 | CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/";
425 | COPY_PHASE_STRIP = YES;
426 | DEAD_CODE_STRIPPING = YES;
427 | GCC_AUTO_VECTORIZATION = YES;
428 | GCC_ENABLE_SSE3_EXTENSIONS = YES;
429 | GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES;
430 | GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
431 | GCC_OPTIMIZATION_LEVEL = 3;
432 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
433 | GCC_UNROLL_LOOPS = YES;
434 | GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES;
435 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO;
436 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO;
437 | GCC_WARN_UNINITIALIZED_AUTOS = NO;
438 | GCC_WARN_UNUSED_VALUE = NO;
439 | GCC_WARN_UNUSED_VARIABLE = NO;
440 | HEADER_SEARCH_PATHS = (
441 | "$(OF_CORE_HEADERS)",
442 | src,
443 | );
444 | MACOSX_DEPLOYMENT_TARGET = 10.6;
445 | OTHER_CPLUSPLUSFLAGS = (
446 | "-D__MACOSX_CORE__",
447 | "-lpthread",
448 | "-mtune=native",
449 | );
450 | SDKROOT = macosx;
451 | };
452 | name = Release;
453 | };
454 | E4B69B600A3A1757003C02F2 /* Debug */ = {
455 | isa = XCBuildConfiguration;
456 | buildSettings = {
457 | COMBINE_HIDPI_IMAGES = YES;
458 | COPY_PHASE_STRIP = NO;
459 | FRAMEWORK_SEARCH_PATHS = (
460 | "$(inherited)",
461 | "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
462 | );
463 | FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\"";
464 | GCC_DYNAMIC_NO_PIC = NO;
465 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
466 | GCC_MODEL_TUNING = NONE;
467 | ICON = "$(ICON_NAME_DEBUG)";
468 | ICON_FILE = "$(ICON_FILE_PATH)$(ICON)";
469 | INFOPLIST_FILE = "openFrameworks-Info.plist";
470 | INSTALL_PATH = "$(HOME)/Applications";
471 | LIBRARY_SEARCH_PATHS = (
472 | "$(inherited)",
473 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
474 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
475 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)",
476 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)",
477 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5)",
478 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6)",
479 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)",
480 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)",
481 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)",
482 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)",
483 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)",
484 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)",
485 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)",
486 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14)",
487 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15)",
488 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
489 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)",
490 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)",
491 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)",
492 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)",
493 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)",
494 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)",
495 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)",
496 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)",
497 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_16)",
498 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_17)",
499 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_18)",
500 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_19)",
501 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_20)",
502 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_21)",
503 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_22)",
504 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_23)",
505 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_24)",
506 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_25)",
507 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_26)",
508 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_27)",
509 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_28)",
510 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_29)",
511 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_30)",
512 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_31)",
513 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_32)",
514 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_33)",
515 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_34)",
516 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_35)",
517 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_36)",
518 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_37)",
519 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_38)",
520 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_39)",
521 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_40)",
522 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_41)",
523 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_42)",
524 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_43)",
525 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_44)",
526 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_45)",
527 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_46)",
528 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_47)",
529 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_48)",
530 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_49)",
531 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_50)",
532 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_51)",
533 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_52)",
534 | );
535 | PRODUCT_NAME = "gpu curl 2DDebug";
536 | WRAPPER_EXTENSION = app;
537 | };
538 | name = Debug;
539 | };
540 | E4B69B610A3A1757003C02F2 /* Release */ = {
541 | isa = XCBuildConfiguration;
542 | buildSettings = {
543 | COMBINE_HIDPI_IMAGES = YES;
544 | COPY_PHASE_STRIP = YES;
545 | FRAMEWORK_SEARCH_PATHS = (
546 | "$(inherited)",
547 | "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
548 | );
549 | FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\"";
550 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
551 | GCC_MODEL_TUNING = NONE;
552 | ICON = "$(ICON_NAME_RELEASE)";
553 | ICON_FILE = "$(ICON_FILE_PATH)$(ICON)";
554 | INFOPLIST_FILE = "openFrameworks-Info.plist";
555 | INSTALL_PATH = "$(HOME)/Applications";
556 | LIBRARY_SEARCH_PATHS = (
557 | "$(inherited)",
558 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
559 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
560 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)",
561 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)",
562 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5)",
563 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6)",
564 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)",
565 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)",
566 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)",
567 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)",
568 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)",
569 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)",
570 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)",
571 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14)",
572 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15)",
573 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
574 | "$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
575 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)",
576 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)",
577 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)",
578 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)",
579 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)",
580 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)",
581 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)",
582 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)",
583 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_16)",
584 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_17)",
585 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_18)",
586 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_19)",
587 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_20)",
588 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_21)",
589 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_22)",
590 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_23)",
591 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_24)",
592 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_25)",
593 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_26)",
594 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_27)",
595 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_28)",
596 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_29)",
597 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_30)",
598 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_31)",
599 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_32)",
600 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_33)",
601 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_34)",
602 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_35)",
603 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_36)",
604 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_37)",
605 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_38)",
606 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_39)",
607 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_40)",
608 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_41)",
609 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_42)",
610 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_43)",
611 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_44)",
612 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_45)",
613 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_46)",
614 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_47)",
615 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_48)",
616 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_49)",
617 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_50)",
618 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_51)",
619 | );
620 | PRODUCT_NAME = "gpu curl 2D";
621 | WRAPPER_EXTENSION = app;
622 | };
623 | name = Release;
624 | };
625 | /* End XCBuildConfiguration section */
626 |
627 | /* Begin XCConfigurationList section */
628 | E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "gpu curl 2D" */ = {
629 | isa = XCConfigurationList;
630 | buildConfigurations = (
631 | E4B69B4E0A3A1720003C02F2 /* Debug */,
632 | E4B69B4F0A3A1720003C02F2 /* Release */,
633 | );
634 | defaultConfigurationIsVisible = 0;
635 | defaultConfigurationName = Release;
636 | };
637 | E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "gpu curl 2D" */ = {
638 | isa = XCConfigurationList;
639 | buildConfigurations = (
640 | E4B69B600A3A1757003C02F2 /* Debug */,
641 | E4B69B610A3A1757003C02F2 /* Release */,
642 | );
643 | defaultConfigurationIsVisible = 0;
644 | defaultConfigurationName = Release;
645 | };
646 | /* End XCConfigurationList section */
647 | };
648 | rootObject = E4B69B4C0A3A1720003C02F2 /* Project object */;
649 | }
650 |
--------------------------------------------------------------------------------
/gpu curl 2D.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/gpu curl 2D.xcodeproj/project.xcworkspace/xcuserdata/peterw.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/petewerner/gpu-curl-2d/3aca78b71bba361965b4d150abcaa3d88f3898b0/gpu curl 2D.xcodeproj/project.xcworkspace/xcuserdata/peterw.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/gpu curl 2D.xcodeproj/project.xcworkspace/xcuserdata/peterw.xcuserdatad/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges
6 |
7 | SnapshotAutomaticallyBeforeSignificantChanges
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/gpu curl 2D.xcodeproj/xcshareddata/xcschemes/emptyExample Debug.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
51 |
52 |
58 |
59 |
60 |
61 |
62 |
63 |
69 |
70 |
76 |
77 |
78 |
79 |
81 |
82 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/gpu curl 2D.xcodeproj/xcshareddata/xcschemes/emptyExample Release.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
51 |
52 |
58 |
59 |
60 |
61 |
62 |
63 |
69 |
70 |
76 |
77 |
78 |
79 |
81 |
82 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/gpu curl 2D.xcodeproj/xcuserdata/peterw.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SuppressBuildableAutocreation
6 |
7 | E4B69B5A0A3A1756003C02F2
8 |
9 | primary
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/openFrameworks-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | com.yourcompany.openFrameworks
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | APPL
15 | CFBundleSignature
16 | ????
17 | CFBundleVersion
18 | 1.0
19 | CFBundleIconFile
20 | ${ICON}
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/OctaveNoise.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // OctaveNoise.cpp
3 | //
4 | // Created by Peter Werner on 4/02/15.
5 | //
6 | //
7 |
8 | #include "OctaveNoise.h"
9 |
10 | void
11 | OctaveNoise::setup(int octaves, double alpha, double beta, bool useSign)
12 | {
13 | this->octaves = octaves;
14 | this->alpha = alpha;
15 | this->beta = beta;
16 | this->useSign = useSign;
17 | }
18 |
19 | float
20 | OctaveNoise::noise(float x, float y)
21 | {
22 | double sum = 0;
23 | double scale = 1.0;
24 | double p[2];
25 |
26 | p[0] = x;
27 | p[1] = y;
28 |
29 | for (int k = 0; k < octaves; k++) {
30 | double val;
31 | if (useSign)
32 | val = ofSignedNoise(p[0], p[1]);
33 | else
34 | val = ofNoise(p[0], p[1]);
35 | sum += val / scale;
36 | scale *= alpha;
37 | p[0] *= beta;
38 | p[1] *= beta;
39 | }
40 |
41 | return sum;
42 |
43 | }
44 |
45 | void OctaveNoise::renderToImage(ofFloatImage &img, float xoff, float yoff)
46 | {
47 | float w = img.getWidth();
48 | float h = img.getHeight();
49 |
50 | for (int x = 0; x < w; x++) {
51 | for (int y = 0; y < h; y++) {
52 | float x0 = (x / (w - 1)) + xoff;
53 | float y0 = (y / (h - 1)) + yoff;
54 | float v = this->noise(x0, y0);
55 | img.setColor(x, y, ofFloatColor(v));
56 | }
57 | }
58 | img.update();
59 | }
60 |
61 | void
62 | OctaveNoise::normalizeImage(ofFloatImage &img)
63 | {
64 | float minv = 9000.0f;
65 | float maxv = -minv;
66 |
67 | for (int x = 0; x < img.getWidth(); x++) {
68 | for (int y = 0; y < img.getHeight(); y++) {
69 | float v = img.getColor(x, y).r;
70 | minv = min(minv, v);
71 | maxv = max(maxv, v);
72 | }
73 | }
74 |
75 | return normalizeImage(img, minv, maxv);
76 | }
77 |
78 | void
79 | OctaveNoise::normalizeImage(ofFloatImage &img, float minval, float maxval)
80 | {
81 | for (int x = 0; x < img.getWidth(); x++) {
82 | for (int y = 0; y < img.getHeight(); y++) {
83 | float v = img.getColor(x, y).r;
84 | v = ofMap(v, minval, maxval, 0.0f, 1.0f);
85 | img.setColor(x, y, ofFloatColor(v, v, v, 1));
86 | }
87 | }
88 | img.update();
89 | }
90 |
91 | void
92 | OctaveNoise::setOctaves(int octaves)
93 | {
94 | this->octaves = max(1, octaves);
95 | }
96 |
97 | void
98 | OctaveNoise::setAlpha(double alpha)
99 | {
100 | this->alpha = max(0.1, alpha);
101 | }
102 |
103 | void
104 | OctaveNoise::setBeta(double beta)
105 | {
106 | this->beta = max(0.1, beta);
107 | }
108 |
109 | void
110 | OctaveNoise::setSigned(bool isSigned)
111 | {
112 | this->useSign = isSigned;
113 | }
114 |
--------------------------------------------------------------------------------
/src/OctaveNoise.h:
--------------------------------------------------------------------------------
1 | //
2 | // OctaveNoise.h
3 | // gpu curl
4 | //
5 | // Created by Peter Werner on 4/02/15.
6 | //
7 | //
8 |
9 | #include "ofMain.h"
10 |
11 | class OctaveNoise {
12 | public:
13 | OctaveNoise(): octaves(3), alpha(2.0), beta(2.0), useSign(false) {};
14 | void setup(int octaves, double alpha, double beta, bool useSign = false);
15 | float noise(float x, float y);
16 |
17 | int getOctaves() { return octaves; }
18 | double getAlpha() { return alpha; }
19 | double getBeta() { return beta; }
20 |
21 | void setOctaves(int octaves);
22 | void setAlpha(double alpha);
23 | void setBeta(double beta);
24 | void setSigned(bool isSigned);
25 | void renderToImage(ofFloatImage &img, float xoff = 0.0, float yoff = 0.0);
26 | void normalizeImage(ofFloatImage &img);
27 | void normalizeImage(ofFloatImage &img, float minval, float maxval);
28 | private:
29 | int octaves;
30 | double alpha;
31 | double beta;
32 | bool useSign;
33 | };
--------------------------------------------------------------------------------
/src/main.cpp:
--------------------------------------------------------------------------------
1 | #include "ofMain.h"
2 | #include "testApp.h"
3 |
4 | //========================================================================
5 | int main( ){
6 |
7 | ofSetCurrentRenderer(ofGLProgrammableRenderer::TYPE);
8 |
9 | ofSetupOpenGL(1024,768, OF_WINDOW);
10 |
11 |
12 | // this kicks off the running of my app
13 | // can be OF_WINDOW or OF_FULLSCREEN
14 | // pass in width and height too:
15 | ofRunApp( new testApp());
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src/testApp.cpp:
--------------------------------------------------------------------------------
1 | #include "testApp.h"
2 |
3 | /*
4 | * A simple example of generating the curl of perlin noise in 2D using the gpu
5 | */
6 |
7 | OctaveNoise noiseGen;
8 | ofFloatImage noiseImage;
9 | ofFbo curlTarget;
10 | ofFloatImage curlDrawImage;
11 | ofFloatImage curlData;
12 |
13 | Timer t;
14 |
15 | float step;
16 | float dt;
17 |
18 | ofShader advectShader;
19 |
20 | static GLuint vaoVec[2];
21 | GLuint advectProgram;
22 |
23 | static GLuint ParticleBufferB;
24 | static GLuint ParticleBufferA;
25 |
26 | GLuint SlotPosition;
27 | u_int curvao;
28 |
29 |
30 | int partcnt = 1000000;
31 | vector particles;
32 |
33 | float update_time;
34 | float width, height;
35 |
36 | int drawMode = 0;
37 | int drawModeMax = 3;
38 |
39 | bool drawGui;
40 |
41 | //--------------------------------------------------------------
42 | void testApp::setup(){
43 |
44 | width = ofGetWidth();
45 | height = ofGetHeight();
46 |
47 | ofDisableArbTex();
48 | ofEnableNormalizedTexCoords();
49 |
50 | setupCtlGui(10, 10);
51 |
52 | //dimensions of the noise texture
53 | float w = 64.0;
54 | float h = w;
55 |
56 | noiseGen.setup(3, 4.0, 3.0);
57 | noiseGen.setSigned(false);
58 |
59 | noiseImage.allocate(w, h, OF_IMAGE_GRAYSCALE);
60 | noiseGen.renderToImage(noiseImage);
61 |
62 | imgMinMax(noiseImage);
63 |
64 | step = 0;
65 | dt = 0.005;
66 |
67 | curl.load("curl");
68 |
69 | ofLogLevel ll = ofGetLogLevel();
70 | ofSetLogLevel(OF_LOG_WARNING);
71 | curlTarget.allocate(w, h, GL_RGBA32F_ARB);
72 | curlTarget.getTextureReference().setTextureMinMagFilter(GL_LINEAR, GL_LINEAR);
73 | curlTarget.getTextureReference().setTextureWrap(GL_CLAMP, GL_CLAMP);
74 |
75 | ofSetLogLevel(ll);
76 |
77 | setupTranformFeedback();
78 |
79 | drawGui = true;
80 | }
81 |
82 | //--------------------------------------------------------------
83 | void testApp::update(){
84 |
85 | //this checks to see if noise params has changed and generates the curl if so
86 | setupNoise();
87 |
88 | step += dt;
89 |
90 | t.begin("update");
91 | advect();
92 | t.end();
93 | update_time = t.getval();
94 | }
95 |
96 | //--------------------------------------------------------------
97 | void testApp::draw(){
98 |
99 | ofClear(0, 255);
100 | ofSetColor(255);
101 |
102 | switch (drawMode) {
103 | case 1:
104 | noiseImage.draw(0, 0, ofGetWidth(), ofGetHeight());
105 | break;
106 | case 2:
107 | curlDrawImage.draw(0, 0, ofGetWidth(), ofGetHeight());
108 | break;
109 | default:
110 | break;
111 | }
112 |
113 | glPointSize(1.0);
114 | glEnable(GL_BLEND);
115 |
116 | ofSetColor(254, 255 * drawAlpha);
117 | glBindVertexArray(vaoVec[curvao]);
118 | glDrawArrays(GL_POINTS, 0, partcnt);
119 | glBindVertexArray(0);
120 |
121 | glDisable(GL_BLEND);
122 |
123 |
124 | if (drawGui) {
125 | ofSetColor(255, 255);
126 | ofEnableAlphaBlending();
127 | ctlGui.draw();
128 |
129 | if (noiseDebugView) {
130 | float dispw, disph;
131 | disph = dispw = 200.0;
132 |
133 | ofPushMatrix();
134 |
135 | ofTranslate(ofGetWidth() - dispw, 0);
136 | noiseImage.draw(0, 0, dispw, disph);
137 | ofTranslate(0, disph);
138 | curlTarget.draw(0, 0, dispw, disph);
139 | ofTranslate(0, disph);
140 | curlDrawImage.draw(0, 0, dispw, disph);
141 |
142 | ofPopMatrix();
143 | }
144 |
145 | stringstream ss;
146 | ss << "FPS: " << ofToString(ofGetFrameRate(), 0) << endl
147 | << "upd: " << ofToString(update_time, 1) << endl
148 | << "parts: " << partcnt << endl
149 | << endl;
150 |
151 | ofPushStyle();
152 | ofPushMatrix();
153 | float boxw = 150.0;
154 | float boxh = 60.0f;
155 | ofTranslate(width - boxw, height - boxh);
156 | ofSetColor(0, 255);
157 | ofRect(0, 0, boxw, boxh);
158 | ofSetColor(255);
159 | ofDrawBitmapString(ss.str(), 10, 20);
160 | ofPopMatrix();
161 | ofPopStyle();
162 | }
163 |
164 | }
165 |
166 | void testApp::exit()
167 | {
168 | saveCtlGui();
169 | }
170 |
171 |
172 | void testApp::genCurl()
173 | {
174 | curlTarget.begin();
175 | ofClear(0, 255);
176 | ofSetColor(255, 255);
177 | curl.begin();
178 | curl.setUniformTexture("uPtex", noiseImage.getTextureReference(), 0);
179 | curl.setUniform2f("dims", noiseImage.getWidth(), noiseImage.getHeight());
180 |
181 | ofRect(0, 0, curlTarget.getWidth(), curlTarget.getHeight());
182 | curl.end();
183 |
184 | curlTarget.end();
185 |
186 | // this stuff isnt really required, done so I can see the noise/curl
187 | curlData.allocate(curlTarget.getWidth(), curlTarget.getHeight(), OF_IMAGE_COLOR_ALPHA);
188 | ofLogLevel ll = ofGetLogLevel();
189 | ofSetLogLevel(OF_LOG_FATAL_ERROR);
190 | curlTarget.getTextureReference().readToPixels(curlData.getPixelsRef());
191 | ofSetLogLevel(ll);
192 | curlData.update();
193 |
194 | cout <<"curl min/max" << endl;
195 | imgMinMax(curlData);
196 |
197 | curlDrawImage.allocate(curlTarget.getWidth(), curlTarget.getHeight(), OF_IMAGE_COLOR_ALPHA);
198 | curlDrawImage = curlData;
199 | noiseGen.normalizeImage(curlDrawImage);
200 | }
201 |
202 | void testApp::advect()
203 | {
204 | advectShader.begin();
205 | advectShader.setUniformTexture("Sampler", curlTarget.getTextureReference(), 0);
206 | advectShader.setUniform1f("Time", step);
207 | advectShader.setUniform1f("curlamt", curlAmt);
208 | advectShader.setUniform2f("constVel", constXval, constYval);
209 | advectShader.setUniform1f("advectDt", advectDt);
210 | advectShader.setUniform2f("dims", ofGetWidth(), ofGetHeight());
211 | glBindVertexArray(vaoVec[curvao]);
212 |
213 | glEnable(GL_RASTERIZER_DISCARD);
214 |
215 | GLuint tgt = curvao == 0 ? ParticleBufferB : ParticleBufferA;
216 | glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, tgt);
217 |
218 | glBeginTransformFeedback(GL_POINTS);
219 | glDrawArrays(GL_POINTS, 0, partcnt);
220 | glEndTransformFeedback();
221 |
222 | glBindVertexArray(0);
223 | glDisable(GL_RASTERIZER_DISCARD);
224 |
225 | advectShader.end();
226 |
227 | curvao = (curvao + 1) % 2;
228 | }
229 |
230 | void testApp::setupTranformFeedback()
231 | {
232 |
233 | particles.resize(partcnt);
234 | for (int i = 0; i < partcnt; i++)
235 | particles[i] = ofVec2f(ofRandomWidth(), ofRandomHeight());
236 |
237 | advectShader.setupShaderFromFile(GL_VERTEX_SHADER, "advect.vert");
238 | advectShader.bindDefaults();
239 | advectProgram = advectShader.getProgram();
240 |
241 | const char* varyings[1] = { "vPosition"};
242 | glTransformFeedbackVaryings(advectProgram, 1, varyings, GL_INTERLEAVED_ATTRIBS);
243 |
244 | advectShader.linkProgram();
245 |
246 | SlotPosition = advectShader.getAttributeLocation("Position");
247 |
248 | glGenBuffers(1, &ParticleBufferA);
249 | glBindBuffer(GL_ARRAY_BUFFER, ParticleBufferA);
250 | glBufferData(GL_ARRAY_BUFFER, partcnt * sizeof(ofVec2f), &particles[0], GL_STREAM_DRAW);
251 | glBindBuffer(GL_ARRAY_BUFFER, 0);
252 |
253 | glGenBuffers(1, &ParticleBufferB);
254 | glBindBuffer(GL_ARRAY_BUFFER, ParticleBufferB);
255 | glBufferData(GL_ARRAY_BUFFER, partcnt * sizeof(ofVec2f), 0, GL_STREAM_DRAW);
256 | glBindBuffer(GL_ARRAY_BUFFER, 0);
257 |
258 | //setup VAOs
259 | glGenVertexArrays(2, vaoVec);
260 |
261 | glBindVertexArray(vaoVec[0]);
262 |
263 | glBindBuffer(GL_ARRAY_BUFFER, ParticleBufferA);
264 | glEnableVertexAttribArray(SlotPosition);
265 | glVertexAttribPointer(SlotPosition, 2, GL_FLOAT, GL_FALSE, sizeof(ofVec2f), 0);
266 |
267 | glBindVertexArray(vaoVec[1]);
268 |
269 | glBindBuffer(GL_ARRAY_BUFFER, ParticleBufferB);
270 | glEnableVertexAttribArray(SlotPosition);
271 | glVertexAttribPointer(SlotPosition, 2, GL_FLOAT, GL_FALSE, sizeof(ofVec2f), 0);
272 |
273 |
274 | glBindVertexArray(0);
275 | glBindBuffer(GL_ARRAY_BUFFER, 0);
276 |
277 | curvao = 0;
278 | }
279 |
280 |
281 | #pragma mark - misc/util -
282 |
283 | void testApp::imgMinMax(ofFloatImage &img)
284 | {
285 | ofVec4f minvals(9000.0f);
286 | ofVec4f maxvals(-9000.0f);
287 |
288 | for (int x = 0; x < img.getWidth(); x++) {
289 | for (int y = 0; y < img.getHeight(); y++) {
290 | ofFloatColor a = img.getColor(x, y);
291 | minvals.x = min(minvals.x, a.r);
292 | minvals.y = min(minvals.y, a.g);
293 | minvals.z = min(minvals.z, a.b);
294 | minvals.w = min(minvals.w, a.a);
295 | maxvals.x = max(maxvals.x, a.r);
296 | maxvals.y = max(maxvals.y, a.g);
297 | maxvals.z = max(maxvals.z, a.b);
298 | maxvals.w = max(maxvals.w, a.a);
299 |
300 | }
301 | }
302 | cout << "minvals: " << minvals << endl;
303 | cout << "maxvals: " << maxvals << endl;
304 |
305 | }
306 |
307 | #pragma mark - Ctl Gui -
308 |
309 | void testApp::setupCtlGui(int x, int y)
310 | {
311 | ctlGui.setup("ctls", ctlGuiFile, x, y);
312 |
313 | ctlGui.add(numOctaves.setup("octaves", 1, 1, 8));
314 | ctlGui.add(noiseAlpha.setup("alpha", 2.0, 0.1, 8.0));
315 | ctlGui.add(noiseBeta.setup("beta", 2.0, 0.1, 8.0));
316 | ctlGui.add(noiseSigned.setup("signed", false));
317 | ctlGui.add(noiseDebugView.setup("noise view", false));
318 |
319 | ctlGui.add(constXval.setup("x amt", 0.0, -2.0, 2.0));
320 | ctlGui.add(constYval.setup("y amt", 0.0, -2.0, 2.0));
321 | ctlGui.add(curlAmt.setup("curl amt", 0.25, 0.0, 2.0));
322 | ctlGui.add(advectDt.setup("advect dt", 1.0, 0.0, 2.0));
323 | ctlGui.add(drawAlpha.setup("draw alpha", 1.0, 0.0, 1.0));
324 |
325 | ctlGui.loadFromFile(ctlGuiFile);
326 |
327 | numOctaves.addListener(this, &testApp::noiseParamIntChanged);
328 | noiseAlpha.addListener(this, &testApp::noiseParamFloatChanged);
329 | noiseBeta.addListener(this, &testApp::noiseParamFloatChanged);
330 | noiseSigned.addListener(this, &testApp::noiseParamBoolChanged);
331 |
332 | noiseDirty = true;
333 | }
334 |
335 | void testApp::saveCtlGui()
336 | {
337 | ctlGui.saveToFile(ctlGuiFile);
338 | }
339 |
340 | void testApp::setupNoise()
341 | {
342 | if (noiseDirty == false)
343 | return;
344 |
345 | noiseGen.setup(numOctaves, noiseAlpha, noiseBeta);
346 | noiseGen.setSigned(noiseSigned);
347 | updateNoise();
348 | noiseDirty = false;
349 | }
350 |
351 | void testApp::updateNoise()
352 | {
353 | noiseGen.renderToImage(noiseImage);
354 | genCurl();
355 | }
356 |
357 | void testApp::noiseParamBoolChanged(bool &v) { noiseDirty = true; }
358 | void testApp::noiseParamFloatChanged(float &v) { noiseDirty = true; }
359 | void testApp::noiseParamIntChanged(int &v) { noiseDirty = true; }
360 |
361 | #pragma mark - oF events -
362 |
363 | //--------------------------------------------------------------
364 | void testApp::keyPressed(int key){
365 | switch (key) {
366 | case 'm':
367 | drawMode = (drawMode + 1) % drawModeMax;
368 | break;
369 | case 'g':
370 | drawGui = !drawGui;
371 | break;
372 | case 'f':
373 | ofToggleFullscreen();
374 | width = ofGetWidth();
375 | height = ofGetHeight();
376 | break;
377 | default:
378 | break;
379 | }
380 |
381 | }
382 |
383 | //--------------------------------------------------------------
384 | void testApp::keyReleased(int key){
385 |
386 | }
387 |
388 | //--------------------------------------------------------------
389 | void testApp::mouseMoved(int x, int y){
390 |
391 | }
392 |
393 | //--------------------------------------------------------------
394 | void testApp::mouseDragged(int x, int y, int button){
395 |
396 | }
397 |
398 | //--------------------------------------------------------------
399 | void testApp::mousePressed(int x, int y, int button){
400 |
401 | }
402 |
403 | //--------------------------------------------------------------
404 | void testApp::mouseReleased(int x, int y, int button){
405 |
406 | }
407 |
408 | //--------------------------------------------------------------
409 | void testApp::windowResized(int w, int h){
410 |
411 | }
412 |
413 | //--------------------------------------------------------------
414 | void testApp::gotMessage(ofMessage msg){
415 |
416 | }
417 |
418 | //--------------------------------------------------------------
419 | void testApp::dragEvent(ofDragInfo dragInfo){
420 |
421 | }
--------------------------------------------------------------------------------
/src/testApp.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "ofMain.h"
4 | #include "ofxGui.h"
5 | #include "OctaveNoise.h"
6 |
7 | class testApp : public ofBaseApp{
8 | public:
9 | void setup();
10 | void update();
11 | void draw();
12 | void exit();
13 |
14 | void keyPressed(int key);
15 | void keyReleased(int key);
16 | void mouseMoved(int x, int y);
17 | void mouseDragged(int x, int y, int button);
18 | void mousePressed(int x, int y, int button);
19 | void mouseReleased(int x, int y, int button);
20 | void windowResized(int w, int h);
21 | void dragEvent(ofDragInfo dragInfo);
22 | void gotMessage(ofMessage msg);
23 |
24 | void setupCtlGui(int x, int y);
25 | void saveCtlGui();
26 | void setupNoise();
27 | void updateNoise();
28 |
29 | ofShader curl;
30 |
31 | void genCurl();
32 |
33 | void setupTranformFeedback();
34 |
35 | void advect();
36 |
37 | void imgMinMax(ofFloatImage &img);
38 |
39 | ofxPanel ctlGui;
40 | string ctlGuiFile = "gui.ctls.xml";
41 | ofxIntSlider numOctaves;
42 | ofxFloatSlider noiseAlpha;
43 | ofxFloatSlider noiseBeta;
44 | ofxToggle noiseSigned;
45 | ofxToggle noiseDebugView;
46 | ofxFloatSlider constXval;
47 | ofxFloatSlider constYval;
48 | ofxFloatSlider curlAmt;
49 | ofxFloatSlider advectDt;
50 | ofxFloatSlider drawAlpha;
51 |
52 |
53 | void noiseParamIntChanged(int & v);
54 | void noiseParamFloatChanged(float & v);
55 | void noiseParamBoolChanged(bool & v);
56 | bool noiseDirty;
57 | };
58 |
59 |
60 |
61 | class Timer {
62 | public:
63 |
64 | void begin() {
65 | begin("timer");
66 | }
67 | void begin(string name) {
68 | val = 0;
69 | ts = ofGetElapsedTimef();
70 | te = 0;
71 | this->name = name;
72 | }
73 | void end() {
74 | te = ofGetElapsedTimef();
75 | val = (te - ts) * 1000.0f;
76 | // print();
77 | }
78 | void print() {
79 | cout << name << ": " << ofToString(val, 4, 7, ' ') << endl;
80 | }
81 | float getval() { return val; }
82 | private:
83 | string name;
84 | float ts, te, val;
85 |
86 | };
--------------------------------------------------------------------------------