Skip to content

Commit fa47971

Browse files
Merge branch 'master' into device-memory-allocate-flags
2 parents 9bf5c97 + 962944d commit fa47971

50 files changed

Lines changed: 53561 additions & 48397 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ set(PBR_DEFINES
163163
-v "VSG_DIFFUSE_MAP VSG_METALLROUGHNESS_MAP VSG_NORMAL_MAP"
164164
-v "VSG_DIFFUSE_MAP VSG_METALLROUGHNESS_MAP VSG_TWO_SIDED_LIGHTING"
165165
-v "VSG_DIFFUSE_MAP VSG_NORMAL_MAP VSG_TWO_SIDED_LIGHTING"
166-
-v "VSG_LIGHTMAP_MAP VSG_NORMAL_MAP VSG_WORKFLOW_SPECGLOSS"
167166
-v "VSG_DIFFUSE_MAP VSG_EMISSIVE_MAP VSG_METALLROUGHNESS_MAP VSG_NORMAL_MAP"
168167
-v "VSG_DIFFUSE_MAP VSG_LIGHTMAP_MAP VSG_METALLROUGHNESS_MAP VSG_NORMAL_MAP"
169168
-v "VSG_DIFFUSE_MAP VSG_LIGHTMAP_MAP VSG_NORMAL_MAP VSG_TWO_SIDED_LIGHTING"
@@ -174,8 +173,15 @@ set(PBR_DEFINES
174173
-v "VSG_DIFFUSE_MAP VSG_LIGHTMAP_MAP VSG_METALLROUGHNESS_MAP VSG_NORMAL_MAP VSG_WORKFLOW_SPECGLOSS"
175174
-v "VSG_DIFFUSE_MAP VSG_EMISSIVE_MAP VSG_LIGHTMAP_MAP VSG_METALLROUGHNESS_MAP VSG_NORMAL_MAP VSG_TWO_SIDED_LIGHTING"
176175
-v "VSG_DIFFUSE_MAP VSG_EMISSIVE_MAP VSG_LIGHTMAP_MAP VSG_NORMAL_MAP VSG_SPECULAR_MAP VSG_WORKFLOW_SPECGLOSS"
176+
-v "VSG_DIFFUSE_MAP VSG_INSTANCE_ROTATION VSG_INSTANCE_SCALE VSG_INSTANCE_TRANSLATION VSG_TWO_SIDED_LIGHTING"
177+
-v "VSG_DIFFUSE_MAP VSG_INSTANCE_ROTATION VSG_INSTANCE_SCALE VSG_INSTANCE_TRANSLATION"
178+
-v "VSG_LIGHTMAP_MAP VSG_NORMAL_MAP VSG_WORKFLOW_SPECGLOSS"
177179
-v "VSG_DISPLACEMENT_MAP VSG_DIFFUSE_MAP"
178180
-v "VSG_DISPLACEMENT_MAP VSG_DETAIL_MAP VSG_DIFFUSE_MAP"
181+
-v "VSG_ALPHA_TEST VSG_DIFFUSE_MAP VSG_INSTANCE_ROTATION VSG_INSTANCE_SCALE VSG_INSTANCE_TRANSLATION VSG_NORMAL_MAP"
182+
-v "VSG_ALPHA_TEST VSG_DIFFUSE_MAP VSG_INSTANCE_ROTATION VSG_INSTANCE_SCALE VSG_INSTANCE_TRANSLATION VSG_TWO_SIDED_LIGHTING"
183+
-v "VSG_ALPHA_TEST VSG_DIFFUSE_MAP VSG_INSTANCE_ROTATION VSG_INSTANCE_SCALE VSG_INSTANCE_TRANSLATION"
184+
-v "VSG_ALPHA_TEST VSG_DIFFUSE_MAP"
179185
)
180186
181187
set(PHONG_DEFINES
@@ -185,6 +191,8 @@ set(PHONG_DEFINES
185191
-v "VSG_BILLBOARD VSG_DIFFUSE_MAP"
186192
-v "VSG_DISPLACEMENT_MAP VSG_DIFFUSE_MAP"
187193
-v "VSG_DISPLACEMENT_MAP VSG_DETAIL_MAP VSG_DIFFUSE_MAP"
194+
-v "VSG_INSTANCE_TRANSLATION VSG_INSTANCE_SCALE VSG_INSTANCE_ROTATION"
195+
-v "VSG_INSTANCE_TRANSLATION VSG_INSTANCE_SCALE VSG_INSTANCE_ROTATION VSG_DIFFUSE_MAP"
188196
)
189197
190198
set(FLAT_DEFINES
@@ -194,6 +202,8 @@ set(FLAT_DEFINES
194202
-v "VSG_BILLBOARD VSG_DIFFUSE_MAP"
195203
-v "VSG_DISPLACEMENT_MAP VSG_DIFFUSE_MAP"
196204
-v "VSG_DISPLACEMENT_MAP VSG_DETAIL_MAP VSG_DIFFUSE_MAP"
205+
-v "VSG_INSTANCE_TRANSLATION VSG_INSTANCE_SCALE VSG_INSTANCE_ROTATION"
206+
-v "VSG_INSTANCE_TRANSLATION VSG_INSTANCE_SCALE VSG_INSTANCE_ROTATION VSG_DIFFUSE_MAP"
197207
)
198208
199209
set(TEXT_DEFINES

include/vsg/all.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
6767
#include <vsg/nodes/DepthSorted.h>
6868
#include <vsg/nodes/Geometry.h>
6969
#include <vsg/nodes/Group.h>
70+
#include <vsg/nodes/InstanceDraw.h>
71+
#include <vsg/nodes/InstanceDrawIndexed.h>
72+
#include <vsg/nodes/InstanceNode.h>
7073
#include <vsg/nodes/InstrumentationNode.h>
7174
#include <vsg/nodes/LOD.h>
7275
#include <vsg/nodes/Layer.h>
@@ -267,6 +270,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
267270
#include <vsg/io/DatabasePager.h>
268271
#include <vsg/io/FileSystem.h>
269272
#include <vsg/io/Input.h>
273+
#include <vsg/io/JSONParser.h>
270274
#include <vsg/io/Logger.h>
271275
#include <vsg/io/ObjectFactory.h>
272276
#include <vsg/io/Options.h>

include/vsg/app/RecordTraversal.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ namespace vsg
6363
class CommandGraph;
6464
class RecordedCommandBuffers;
6565
class Instrumentation;
66+
class InstanceNode;
67+
class InstanceDraw;
68+
class InstanceDrawIndexed;
6669

6770
VSG_type_name(vsg::RecordTraversal);
6871

@@ -142,6 +145,11 @@ namespace vsg
142145
// Animation nodes
143146
void apply(const Joint& joint);
144147

148+
// instance nodes
149+
void apply(const InstanceNode& instanceNode);
150+
void apply(const InstanceDraw& instanceDraw);
151+
void apply(const InstanceDrawIndexed& instanceDrawIndexed);
152+
145153
// Vulkan nodes
146154
void apply(const StateGroup& object);
147155

include/vsg/core/Array.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,15 @@ namespace vsg
115115
return ref_ptr<Array>(new Array(std::forward<Args>(args)...));
116116
}
117117

118+
template<typename... Args>
119+
static ref_ptr<Array> create_if(bool flag, Args&&... args)
120+
{
121+
if (flag)
122+
return ref_ptr<Array>(new Array(std::forward<Args>(args)...));
123+
else
124+
return {};
125+
}
126+
118127
static ref_ptr<Array> create(std::initializer_list<value_type> l)
119128
{
120129
return ref_ptr<Array>(new Array(l));
@@ -377,6 +386,9 @@ namespace vsg
377386
VSG_array(floatArray, float);
378387
VSG_array(doubleArray, double);
379388

389+
VSG_array(quatArray, quat);
390+
VSG_array(dquatArray, dquat);
391+
380392
VSG_array(vec2Array, vec2);
381393
VSG_array(vec3Array, vec3);
382394
VSG_array(vec4Array, vec4);

include/vsg/core/Array2D.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,15 @@ namespace vsg
103103
return ref_ptr<Array2D>(new Array2D(std::forward<Args>(args)...));
104104
}
105105

106+
template<typename... Args>
107+
static ref_ptr<Array2D> create_if(bool flag, Args&&... args)
108+
{
109+
if (flag)
110+
return ref_ptr<Array2D>(new Array2D(std::forward<Args>(args)...));
111+
else
112+
return {};
113+
}
114+
106115
ref_ptr<Object> clone(const CopyOp& copyop = {}) const override
107116
{
108117
return ref_ptr<Array2D>(new Array2D(*this, copyop));

include/vsg/core/Array3D.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ namespace vsg
108108
return ref_ptr<Array3D>(new Array3D(std::forward<Args>(args)...));
109109
}
110110

111+
template<typename... Args>
112+
static ref_ptr<Array3D> create_if(bool flag, Args&&... args)
113+
{
114+
if (flag)
115+
return ref_ptr<Array3D>(new Array3D(std::forward<Args>(args)...));
116+
else
117+
return {};
118+
}
119+
111120
ref_ptr<Object> clone(const CopyOp& copyop = {}) const override
112121
{
113122
return ref_ptr<Array3D>(new Array3D(*this, copyop));

include/vsg/core/ConstVisitor.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ namespace vsg
5151
class SpotLight;
5252
class InstrumentationNode;
5353
class RegionOfInterest;
54+
class InstanceNode;
55+
class InstanceDraw;
56+
class InstanceDrawIndexed;
5457

5558
// forward declare text classes
5659
class Text;
@@ -354,6 +357,9 @@ namespace vsg
354357
virtual void apply(const SpotLight&);
355358
virtual void apply(const InstrumentationNode&);
356359
virtual void apply(const RegionOfInterest&);
360+
virtual void apply(const InstanceNode&);
361+
virtual void apply(const InstanceDraw&);
362+
virtual void apply(const InstanceDrawIndexed&);
357363

358364
// text
359365
virtual void apply(const Text&);

include/vsg/core/IntrusiveAllocator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
1515
#include <vsg/core/Allocator.h>
1616

1717
#include <list>
18-
#include <vector>
1918
#include <string>
19+
#include <vector>
2020

2121
namespace vsg
2222
{

include/vsg/core/Value.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ namespace vsg
5858
return ref_ptr<Value>(new Value(std::forward<Args>(args)...));
5959
}
6060

61+
template<typename... Args>
62+
static ref_ptr<Value> create_if(bool flag, Args&&... args)
63+
{
64+
if (flag)
65+
return ref_ptr<Value>(new Value(std::forward<Args>(args)...));
66+
else
67+
return {};
68+
}
69+
6170
ref_ptr<Object> clone(const CopyOp& copyop = {}) const override
6271
{
6372
return ref_ptr<Value>(new Value(*this, copyop));

include/vsg/core/Visitor.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ namespace vsg
5151
class SpotLight;
5252
class InstrumentationNode;
5353
class RegionOfInterest;
54+
class InstanceNode;
55+
class InstanceDraw;
56+
class InstanceDrawIndexed;
5457

5558
// forward declare text classes
5659
class Text;
@@ -354,6 +357,9 @@ namespace vsg
354357
virtual void apply(SpotLight&);
355358
virtual void apply(InstrumentationNode&);
356359
virtual void apply(RegionOfInterest&);
360+
virtual void apply(InstanceNode&);
361+
virtual void apply(InstanceDraw&);
362+
virtual void apply(InstanceDrawIndexed&);
357363

358364
// text
359365
virtual void apply(Text&);

0 commit comments

Comments
 (0)