Compare commits
2 Commits
683115e0c1
...
b9cfcde9c7
| Author | SHA1 | Date | |
|---|---|---|---|
| b9cfcde9c7 | |||
| 4d952b0a90 |
20
Makefile
20
Makefile
@ -50,11 +50,10 @@ SHADERS = \
|
|||||||
$(BUILD_TYPE)/effect/collada.fxo \
|
$(BUILD_TYPE)/effect/collada.fxo \
|
||||||
$(BUILD_TYPE)/effect/collada_scene.fxo
|
$(BUILD_TYPE)/effect/collada_scene.fxo
|
||||||
|
|
||||||
BUFFERS = \
|
SCENES = \
|
||||||
models/curve_interpolation/curve_interpolation.vtx \
|
src/scenes/curve_interpolation/curve_interpolation.cpp
|
||||||
models/curve_interpolation/curve_interpolation.idx
|
|
||||||
|
|
||||||
$(BUILD_TYPE)/%.res: %.rc $(SHADERS) $(BUFFERS)
|
$(BUILD_TYPE)/%.res: %.rc $(SHADERS) $(SCENES)
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
$(WINDRES) -O coff -I$(BUILD_TYPE)/effect -o $@ $<
|
$(WINDRES) -O coff -I$(BUILD_TYPE)/effect -o $@ $<
|
||||||
|
|
||||||
@ -62,6 +61,17 @@ $(BUILD_TYPE)/%.obj: src/%.cpp
|
|||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
$(CXX) $(CXXSTD) $(CFLAGS) $(CXXFLAGS) $(WOPT) $(OPT) -o $@ -c $<
|
$(CXX) $(CXXSTD) $(CFLAGS) $(CXXFLAGS) $(WOPT) $(OPT) -o $@ -c $<
|
||||||
|
|
||||||
|
COLLADA_PY_SOURCE = \
|
||||||
|
$(wildcard collada/*.py)
|
||||||
|
|
||||||
|
include/scenes/%.hpp: $(COLLADA_PY_SOURCE)
|
||||||
|
@mkdir -p $(@D)
|
||||||
|
PYTHONPATH=. python -m collada.main $@
|
||||||
|
|
||||||
|
src/scenes/%.cpp: scenes/%.DAE include/scenes/%.hpp
|
||||||
|
@mkdir -p $(@D)
|
||||||
|
PYTHONPATH=. python -m collada.main $< $@ $(<:.DAE=.vtx) $(<:.DAE=.idx)
|
||||||
|
|
||||||
OBJS = \
|
OBJS = \
|
||||||
$(BUILD_TYPE)/main.res \
|
$(BUILD_TYPE)/main.res \
|
||||||
$(BUILD_TYPE)/robot_player.obj \
|
$(BUILD_TYPE)/robot_player.obj \
|
||||||
@ -72,7 +82,7 @@ OBJS = \
|
|||||||
$(BUILD_TYPE)/input.obj \
|
$(BUILD_TYPE)/input.obj \
|
||||||
$(BUILD_TYPE)/collada.obj \
|
$(BUILD_TYPE)/collada.obj \
|
||||||
$(BUILD_TYPE)/collada_scene.obj \
|
$(BUILD_TYPE)/collada_scene.obj \
|
||||||
$(BUILD_TYPE)/scenes/curve_interpolation.obj
|
$(BUILD_TYPE)/scenes/curve_interpolation/curve_interpolation.obj
|
||||||
|
|
||||||
$(BUILD_TYPE)/d3d10.exe: $(OBJS)
|
$(BUILD_TYPE)/d3d10.exe: $(OBJS)
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
|
|||||||
@ -310,12 +310,23 @@ def render_node_channels(state, collada, node, node_name):
|
|||||||
yield f"&node_channel_{target_name},"
|
yield f"&node_channel_{target_name},"
|
||||||
yield "};"
|
yield "};"
|
||||||
|
|
||||||
|
def render_node_instance_lights(state, collada, node_name, instance_lights):
|
||||||
|
yield f"instance_light const instance_lights_{node_name}[] = {{"
|
||||||
|
for instance_light in instance_lights:
|
||||||
|
light = collada.lookup(instance_light.url, types.Light)
|
||||||
|
light_name = sanitize_name(state, light.id, light)
|
||||||
|
yield "{"
|
||||||
|
yield f".light = &light_{light_name},"
|
||||||
|
yield "}"
|
||||||
|
yield "};"
|
||||||
|
|
||||||
def render_node(state, collada, node, node_index):
|
def render_node(state, collada, node, node_index):
|
||||||
node_name_id = get_node_name_id(node)
|
node_name_id = get_node_name_id(node)
|
||||||
node_name = sanitize_name(state, node_name_id, node)
|
node_name = sanitize_name(state, node_name_id, node)
|
||||||
#yield from render_node_children(state, collada, node_name, node.nodes)
|
#yield from render_node_children(state, collada, node_name, node.nodes)
|
||||||
yield from render_node_transforms(state, collada, node_name, node.transformation_elements)
|
yield from render_node_transforms(state, collada, node_name, node.transformation_elements)
|
||||||
yield from render_node_instance_geometries(state, collada, node_name, node.instance_geometries)
|
yield from render_node_instance_geometries(state, collada, node_name, node.instance_geometries)
|
||||||
|
yield from render_node_instance_lights(state, collada, node_name, node.instance_lights)
|
||||||
yield from render_node_channels(state, collada, node, node_name)
|
yield from render_node_channels(state, collada, node, node_name)
|
||||||
|
|
||||||
type = {
|
type = {
|
||||||
@ -334,6 +345,9 @@ def render_node(state, collada, node, node_index):
|
|||||||
yield f".instance_geometries = instance_geometries_{node_name},"
|
yield f".instance_geometries = instance_geometries_{node_name},"
|
||||||
yield f".instance_geometries_count = {len(node.instance_geometries)},"
|
yield f".instance_geometries_count = {len(node.instance_geometries)},"
|
||||||
yield ""
|
yield ""
|
||||||
|
yield f".instance_lights = instance_lights_{node_name},"
|
||||||
|
yield f".instance_lights_count = {len(node.instance_lights)},"
|
||||||
|
yield ""
|
||||||
yield f".channels = node_channels_{node_name},"
|
yield f".channels = node_channels_{node_name},"
|
||||||
yield f".channels_count = {len(state.node_animation_channels[node.id])},"
|
yield f".channels_count = {len(state.node_animation_channels[node.id])},"
|
||||||
#yield ""
|
#yield ""
|
||||||
@ -392,9 +406,7 @@ def render_opt_float(field_name, f):
|
|||||||
f = types.Float(value=0.0)
|
f = types.Float(value=0.0)
|
||||||
yield f".{field_name} = {float(f.value)}f,"
|
yield f".{field_name} = {float(f.value)}f,"
|
||||||
|
|
||||||
def render_library_effects(state, collada):
|
def render_effect(state, collada, effect):
|
||||||
for library_effects in collada.library_effects:
|
|
||||||
for effect in library_effects.effects:
|
|
||||||
profile_common, = effect.profile_common
|
profile_common, = effect.profile_common
|
||||||
assert profile_common.newparam == []
|
assert profile_common.newparam == []
|
||||||
shader = profile_common.technique.shader
|
shader = profile_common.technique.shader
|
||||||
@ -456,6 +468,11 @@ def render_library_effects(state, collada):
|
|||||||
|
|
||||||
yield "};"
|
yield "};"
|
||||||
|
|
||||||
|
def render_library_effects(state, collada):
|
||||||
|
for library_effects in collada.library_effects:
|
||||||
|
for effect in library_effects.effects:
|
||||||
|
yield from render_effect(state, collada, effect)
|
||||||
|
|
||||||
def render_library_materials(state, collada):
|
def render_library_materials(state, collada):
|
||||||
for library_materials in collada.library_materials:
|
for library_materials in collada.library_materials:
|
||||||
for material in library_materials.materials:
|
for material in library_materials.materials:
|
||||||
@ -655,10 +672,34 @@ def render_library_animations(state, collada):
|
|||||||
yield from render_animation(state, collada, animation_name, animation)
|
yield from render_animation(state, collada, animation_name, animation)
|
||||||
animation_ix += 1
|
animation_ix += 1
|
||||||
|
|
||||||
|
def render_light_type(technique_common: types.TechniqueCommon_Light):
|
||||||
|
return {
|
||||||
|
types.Ambient: "AMBIENT",
|
||||||
|
types.Directional: "DIRECTIONAL",
|
||||||
|
types.Point: "POINT",
|
||||||
|
types.Spot: "SPOT",
|
||||||
|
}[type(technique_common.light)]
|
||||||
|
|
||||||
|
def render_light(state, collada, light):
|
||||||
|
technique_common = light.technique_common
|
||||||
|
light_name = sanitize_name(state, light.id, light)
|
||||||
|
color = ", ".join(f"{float(f)}f" for f in technique_common.light.color)
|
||||||
|
light_type = render_light_type(technique_common)
|
||||||
|
yield f"light const light_{light_name} = {{"
|
||||||
|
yield f".type = light_type::{light_type},"
|
||||||
|
yield f".color = {{ {color} }},"
|
||||||
|
yield "};"
|
||||||
|
|
||||||
|
def render_library_lights(state, collada):
|
||||||
|
for library_lights in collada.library_lights:
|
||||||
|
for light in library_lights.lights:
|
||||||
|
yield from render_light(state, collada, light)
|
||||||
|
|
||||||
def render_all(collada, namespace):
|
def render_all(collada, namespace):
|
||||||
state = State()
|
state = State()
|
||||||
render, out = renderer()
|
render, out = renderer()
|
||||||
render(render_header(namespace))
|
render(render_header(namespace))
|
||||||
|
render(render_library_lights(state, collada))
|
||||||
render(render_library_animations(state, collada))
|
render(render_library_animations(state, collada))
|
||||||
render(render_library_effects(state, collada))
|
render(render_library_effects(state, collada))
|
||||||
render(render_library_materials(state, collada))
|
render(render_library_materials(state, collada))
|
||||||
|
|||||||
@ -6,44 +6,61 @@ from collada import header
|
|||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
name = sys.argv[0]
|
name = sys.argv[0]
|
||||||
print("usage:")
|
print("usage (source):")
|
||||||
print(f" {name} [input_collada.dae] [output_source.cpp] [output_header.hpp] [output_vertex.vtx] [output_vertex.idx]")
|
print(f" {name} [input_collada.dae] [output_source.cpp] [output_vertex.vtx] [output_vertex.idx]")
|
||||||
|
print("usage (header):")
|
||||||
|
print(f" {name} [output_header.hpp]")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
def parse_namespace(filename):
|
||||||
|
namespace = path.splitext(path.split(filename)[1])[0]
|
||||||
|
return namespace
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
try:
|
try:
|
||||||
input_collada = sys.argv[1]
|
input_collada = sys.argv[1]
|
||||||
output_source = sys.argv[2]
|
output_source = sys.argv[2]
|
||||||
output_header = sys.argv[3]
|
output_vertex = sys.argv[3]
|
||||||
output_vertex = sys.argv[4]
|
output_index = sys.argv[4]
|
||||||
output_index = sys.argv[5]
|
|
||||||
assert input_collada.lower().endswith(".dae")
|
assert input_collada.lower().endswith(".dae")
|
||||||
assert output_header.lower().endswith(".hpp")
|
assert output_source.lower().endswith(".cpp")
|
||||||
assert output_vertex.lower().endswith(".vtx")
|
assert output_vertex.lower().endswith(".vtx")
|
||||||
assert output_index.lower().endswith(".idx")
|
assert output_index.lower().endswith(".idx")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
usage()
|
usage()
|
||||||
|
|
||||||
collada = parse.parse_collada_file(input_collada)
|
collada = parse.parse_collada_file(input_collada)
|
||||||
namespace = path.splitext(path.split(input_collada)[1])[0]
|
namespace = parse_namespace(input_collada)
|
||||||
state, out_source = header.render_all(collada, namespace)
|
state, out_source = header.render_all(collada, namespace)
|
||||||
out_header = header.render_all_hpp(namespace)
|
|
||||||
|
|
||||||
with open(output_source, 'wb') as f:
|
with open(output_source, 'wb') as f:
|
||||||
source_buf = out_source.getvalue()
|
source_buf = out_source.getvalue()
|
||||||
assert "\r\n" in source_buf
|
assert "\r\n" in source_buf
|
||||||
f.write(source_buf.encode('utf-8'))
|
f.write(source_buf.encode('utf-8'))
|
||||||
|
|
||||||
with open(output_header, 'wb') as f:
|
|
||||||
header_buf = out_header.getvalue()
|
|
||||||
assert "\r\n" in header_buf
|
|
||||||
f.write(header_buf.encode('utf-8'))
|
|
||||||
|
|
||||||
with open(output_vertex, 'wb') as f:
|
with open(output_vertex, 'wb') as f:
|
||||||
f.write(state.vertex_buffer.getvalue())
|
f.write(state.vertex_buffer.getvalue())
|
||||||
|
|
||||||
with open(output_index, 'wb') as f:
|
with open(output_index, 'wb') as f:
|
||||||
f.write(state.index_buffer.getvalue())
|
f.write(state.index_buffer.getvalue())
|
||||||
|
|
||||||
|
def main_header():
|
||||||
|
try:
|
||||||
|
output_header = sys.argv[1]
|
||||||
|
assert output_header.lower().endswith(".hpp")
|
||||||
|
except Exception as e:
|
||||||
|
usage()
|
||||||
|
|
||||||
|
namespace = parse_namespace(output_header)
|
||||||
|
out_header = header.render_all_hpp(namespace)
|
||||||
|
|
||||||
|
with open(output_header, 'wb') as f:
|
||||||
|
header_buf = out_header.getvalue()
|
||||||
|
assert "\r\n" in header_buf
|
||||||
|
f.write(header_buf.encode('utf-8'))
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
if len(sys.argv) == 2:
|
||||||
|
main_header()
|
||||||
|
else:
|
||||||
main()
|
main()
|
||||||
|
|||||||
@ -37,20 +37,33 @@ namespace collada_scene {
|
|||||||
|
|
||||||
node_instance * m_nodeInstances = NULL;
|
node_instance * m_nodeInstances = NULL;
|
||||||
|
|
||||||
|
XMFLOAT4 * m_lightPositions = NULL;
|
||||||
|
XMFLOAT4 * m_lightDirections = NULL;
|
||||||
|
XMFLOAT4 * m_lightColors = NULL;
|
||||||
|
|
||||||
|
int m_lightInstancesCount = 0;
|
||||||
|
|
||||||
collada::descriptor const * m_descriptor;
|
collada::descriptor const * m_descriptor;
|
||||||
|
|
||||||
HRESULT load_scene(collada::descriptor const * const descriptor);
|
HRESULT load_scene(collada::descriptor const * const descriptor);
|
||||||
void render(float t);
|
void update(float t);
|
||||||
|
void render();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
HRESULT load_layouts();
|
HRESULT load_layouts();
|
||||||
void allocate_node_instances();
|
void allocate_node_instances();
|
||||||
void allocate_node_instance(collada::node const * const node,
|
void allocate_node_instance(collada::node const * const node,
|
||||||
node_instance * node_instance);
|
node_instance * node_instance);
|
||||||
|
void allocate_light_instances();
|
||||||
|
|
||||||
|
void node_world_transform(collada::node const& node, node_instance& node_instance);
|
||||||
|
void update_light_instances();
|
||||||
|
void update_light_instance_vectors(collada::light const& light,
|
||||||
|
node_instance const& node_instance,
|
||||||
|
int light_index);
|
||||||
|
|
||||||
void render_geometries(collada::instance_geometry const * const instance_geometries,
|
void render_geometries(collada::instance_geometry const * const instance_geometries,
|
||||||
int const instance_geometries_count);
|
int const instance_geometries_count);
|
||||||
void node_world_transform(collada::node const& node, node_instance& node_instance);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
HRESULT LoadEffect();
|
HRESULT LoadEffect();
|
||||||
|
|||||||
@ -81,47 +81,24 @@ namespace collada {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// node
|
// light
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
struct lookat {
|
enum class light_type {
|
||||||
float3 const eye;
|
AMBIENT,
|
||||||
float3 const at;
|
DIRECTIONAL,
|
||||||
float3 const up;
|
POINT,
|
||||||
|
SPOT,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct matrix {
|
struct light {
|
||||||
float const _11, _12, _13, _14;
|
light_type type;
|
||||||
float const _21, _22, _23, _24;
|
float3 color;
|
||||||
float const _31, _32, _33, _34;
|
|
||||||
float const _41, _42, _43, _44;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class transform_type {
|
//////////////////////////////////////////////////////////////////////
|
||||||
LOOKAT,
|
// effect
|
||||||
MATRIX,
|
//////////////////////////////////////////////////////////////////////
|
||||||
ROTATE,
|
|
||||||
SCALE,
|
|
||||||
SKEW,
|
|
||||||
TRANSLATE,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct transform {
|
|
||||||
transform_type const type;
|
|
||||||
union {
|
|
||||||
lookat const lookat;
|
|
||||||
matrix const matrix;
|
|
||||||
float4 const rotate;
|
|
||||||
float3 const scale;
|
|
||||||
float7 const skew;
|
|
||||||
float3 const translate;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class node_type {
|
|
||||||
JOINT,
|
|
||||||
NODE,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct color_or_texture {
|
struct color_or_texture {
|
||||||
union {
|
union {
|
||||||
@ -192,12 +169,55 @@ namespace collada {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
// node
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
struct lookat {
|
||||||
|
float3 const eye;
|
||||||
|
float3 const at;
|
||||||
|
float3 const up;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct matrix {
|
||||||
|
float const _11, _12, _13, _14;
|
||||||
|
float const _21, _22, _23, _24;
|
||||||
|
float const _31, _32, _33, _34;
|
||||||
|
float const _41, _42, _43, _44;
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class transform_type {
|
||||||
|
LOOKAT,
|
||||||
|
MATRIX,
|
||||||
|
ROTATE,
|
||||||
|
SCALE,
|
||||||
|
SKEW,
|
||||||
|
TRANSLATE,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct transform {
|
||||||
|
transform_type const type;
|
||||||
|
union {
|
||||||
|
lookat const lookat;
|
||||||
|
matrix const matrix;
|
||||||
|
float4 const rotate;
|
||||||
|
float3 const scale;
|
||||||
|
float7 const skew;
|
||||||
|
float3 const translate;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class node_type {
|
||||||
|
JOINT,
|
||||||
|
NODE,
|
||||||
|
};
|
||||||
|
|
||||||
struct material {
|
struct material {
|
||||||
effect const * const effect;
|
effect const * const effect;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct instance_material {
|
struct instance_material {
|
||||||
int element_index;
|
int element_index; // an index into mesh.triangles
|
||||||
material const * const material;
|
material const * const material;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -208,6 +228,10 @@ namespace collada {
|
|||||||
int const instance_materials_count;
|
int const instance_materials_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct instance_light {
|
||||||
|
light const * const light;
|
||||||
|
};
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// animation
|
// animation
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
@ -286,6 +310,9 @@ namespace collada {
|
|||||||
instance_geometry const * const instance_geometries;
|
instance_geometry const * const instance_geometries;
|
||||||
int const instance_geometries_count;
|
int const instance_geometries_count;
|
||||||
|
|
||||||
|
instance_light const * const instance_lights;
|
||||||
|
int const instance_lights_count;
|
||||||
|
|
||||||
channel const * const * const channels;
|
channel const * const * const channels;
|
||||||
int const channels_count;
|
int const channels_count;
|
||||||
|
|
||||||
|
|||||||
4
main.rc
4
main.rc
@ -10,5 +10,5 @@ RES_FONT_TERMINUS_6X12 RCDATA "font/terminus_128x64_6x12.data"
|
|||||||
RES_COLLADA_FXO RCDATA "collada.fxo"
|
RES_COLLADA_FXO RCDATA "collada.fxo"
|
||||||
|
|
||||||
RES_COLLADA_SCENE_FXO RCDATA "collada_scene.fxo"
|
RES_COLLADA_SCENE_FXO RCDATA "collada_scene.fxo"
|
||||||
RES_MODELS_CURVE_INTERPOLATION_VTX RCDATA "models/curve_interpolation/curve_interpolation.vtx"
|
RES_MODELS_CURVE_INTERPOLATION_VTX RCDATA "scenes/curve_interpolation/curve_interpolation.vtx"
|
||||||
RES_MODELS_CURVE_INTERPOLATION_IDX RCDATA "models/curve_interpolation/curve_interpolation.idx"
|
RES_MODELS_CURVE_INTERPOLATION_IDX RCDATA "scenes/curve_interpolation/curve_interpolation.idx"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -9,6 +9,7 @@
|
|||||||
#include "new.hpp"
|
#include "new.hpp"
|
||||||
|
|
||||||
extern ID3D10Device * g_pd3dDevice;
|
extern ID3D10Device * g_pd3dDevice;
|
||||||
|
extern XMVECTOR g_Eye;
|
||||||
extern XMMATRIX g_View;
|
extern XMMATRIX g_View;
|
||||||
extern XMMATRIX g_Projection;
|
extern XMMATRIX g_Projection;
|
||||||
|
|
||||||
@ -22,6 +23,11 @@ namespace collada_scene {
|
|||||||
ID3D10EffectMatrixVariable * g_pViewVariable = NULL;
|
ID3D10EffectMatrixVariable * g_pViewVariable = NULL;
|
||||||
ID3D10EffectMatrixVariable * g_pProjectionVariable = NULL;
|
ID3D10EffectMatrixVariable * g_pProjectionVariable = NULL;
|
||||||
|
|
||||||
|
ID3D10EffectVectorVariable * g_pViewEyeVariable = NULL;
|
||||||
|
ID3D10EffectVectorVariable * g_pLightPosVariable = NULL;
|
||||||
|
ID3D10EffectVectorVariable * g_pLightDirVariable = NULL;
|
||||||
|
ID3D10EffectVectorVariable * g_pLightColorVariable = NULL;
|
||||||
|
|
||||||
ID3D10EffectVectorVariable * g_pEmissionVariable = NULL;
|
ID3D10EffectVectorVariable * g_pEmissionVariable = NULL;
|
||||||
ID3D10EffectVectorVariable * g_pAmbientVariable = NULL;
|
ID3D10EffectVectorVariable * g_pAmbientVariable = NULL;
|
||||||
ID3D10EffectVectorVariable * g_pDiffuseVariable = NULL;
|
ID3D10EffectVectorVariable * g_pDiffuseVariable = NULL;
|
||||||
@ -67,8 +73,52 @@ namespace collada_scene {
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void scene_state::update_light_instance_vectors(light const& light,
|
||||||
|
node_instance const& node_instance,
|
||||||
|
int light_index)
|
||||||
|
{
|
||||||
|
const XMVECTOR position = XMVectorSet(0, 0, 0, 1);
|
||||||
|
const XMVECTOR direction = XMVectorSet(0, 0, -1, 0);
|
||||||
|
XMVECTOR light_position = XMVector3Transform(position, node_instance.world);
|
||||||
|
XMVECTOR light_direction = XMVector3TransformNormal(direction, node_instance.world);
|
||||||
|
XMVECTOR light_color = XMLoadFloat3((XMFLOAT3 *)&light.color);
|
||||||
|
|
||||||
|
XMStoreFloat4(&m_lightPositions[light_index], light_position);
|
||||||
|
XMStoreFloat4(&m_lightDirections[light_index], light_direction);
|
||||||
|
XMStoreFloat4(&m_lightColors[light_index], light_color);
|
||||||
|
}
|
||||||
|
|
||||||
|
void scene_state::update_light_instances()
|
||||||
|
{
|
||||||
|
int light_index = 0;
|
||||||
|
for (int i = 0; i < m_descriptor->nodes_count; i++) {
|
||||||
|
node const& node = *m_descriptor->nodes[i];
|
||||||
|
node_instance const& node_instance = m_nodeInstances[i];
|
||||||
|
for (int j = 0; j < node.instance_lights_count; j++) {
|
||||||
|
light const& light = *node.instance_lights[j].light;
|
||||||
|
update_light_instance_vectors(light, node_instance, light_index);
|
||||||
|
light_index += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void scene_state::allocate_light_instances()
|
||||||
|
{
|
||||||
|
// count light instances
|
||||||
|
int count = 0;
|
||||||
|
for (int i = 0; i < m_descriptor->nodes_count; i++) {
|
||||||
|
count += m_descriptor->nodes[i]->instance_lights_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
// allocate
|
||||||
|
m_lightInstancesCount = count;
|
||||||
|
m_lightPositions = New<XMFLOAT4>(m_lightInstancesCount);
|
||||||
|
m_lightDirections = New<XMFLOAT4>(m_lightInstancesCount);
|
||||||
|
m_lightColors = New<XMFLOAT4>(m_lightInstancesCount);
|
||||||
|
}
|
||||||
|
|
||||||
static void initialize_node_transforms(node const * const node,
|
static void initialize_node_transforms(node const * const node,
|
||||||
node_instance * node_instance)
|
node_instance * const node_instance)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < node->transforms_count; i++) {
|
for (int i = 0; i < node->transforms_count; i++) {
|
||||||
transform& transform = node_instance->transforms[i];
|
transform& transform = node_instance->transforms[i];
|
||||||
@ -98,7 +148,7 @@ namespace collada_scene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void scene_state::allocate_node_instance(node const * const node,
|
void scene_state::allocate_node_instance(node const * const node,
|
||||||
node_instance * node_instance)
|
node_instance * const node_instance)
|
||||||
{
|
{
|
||||||
node_instance->transforms = New<transform>(node->transforms_count);
|
node_instance->transforms = New<transform>(node->transforms_count);
|
||||||
initialize_node_transforms(node, node_instance);
|
initialize_node_transforms(node, node_instance);
|
||||||
@ -133,6 +183,7 @@ namespace collada_scene {
|
|||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
allocate_node_instances();
|
allocate_node_instances();
|
||||||
|
allocate_light_instances();
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
@ -143,6 +194,7 @@ namespace collada_scene {
|
|||||||
|
|
||||||
D3D10_INPUT_ELEMENT_DESC layout[inputs.elements_count];
|
D3D10_INPUT_ELEMENT_DESC layout[inputs.elements_count];
|
||||||
|
|
||||||
|
assert(inputs.elements_count == 3);
|
||||||
int byte_offset = 0;
|
int byte_offset = 0;
|
||||||
for (int i = 0; i < inputs.elements_count; i++) {
|
for (int i = 0; i < inputs.elements_count; i++) {
|
||||||
layout[i].SemanticName = inputs.elements[i].semantic;
|
layout[i].SemanticName = inputs.elements[i].semantic;
|
||||||
@ -200,6 +252,11 @@ namespace collada_scene {
|
|||||||
g_pViewVariable = g_pEffect->GetVariableByName("View")->AsMatrix();
|
g_pViewVariable = g_pEffect->GetVariableByName("View")->AsMatrix();
|
||||||
g_pProjectionVariable = g_pEffect->GetVariableByName("Projection")->AsMatrix();
|
g_pProjectionVariable = g_pEffect->GetVariableByName("Projection")->AsMatrix();
|
||||||
|
|
||||||
|
g_pViewEyeVariable = g_pEffect->GetVariableByName("ViewEye")->AsVector();
|
||||||
|
g_pLightPosVariable = g_pEffect->GetVariableByName("LightPos")->AsVector();
|
||||||
|
g_pLightDirVariable = g_pEffect->GetVariableByName("LightDir")->AsVector();
|
||||||
|
g_pLightColorVariable = g_pEffect->GetVariableByName("LightColor")->AsVector();
|
||||||
|
|
||||||
g_pEmissionVariable = g_pEffect->GetVariableByName("Emission")->AsVector();
|
g_pEmissionVariable = g_pEffect->GetVariableByName("Emission")->AsVector();
|
||||||
g_pAmbientVariable = g_pEffect->GetVariableByName("Ambient")->AsVector();
|
g_pAmbientVariable = g_pEffect->GetVariableByName("Ambient")->AsVector();
|
||||||
g_pDiffuseVariable = g_pEffect->GetVariableByName("Diffuse")->AsVector();
|
g_pDiffuseVariable = g_pEffect->GetVariableByName("Diffuse")->AsVector();
|
||||||
@ -559,28 +616,59 @@ namespace collada_scene {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void scene_state::render(float t)
|
void scene_state::update(float t)
|
||||||
{
|
{
|
||||||
g_pViewVariable->SetMatrix((float *)&g_View);
|
|
||||||
g_pProjectionVariable->SetMatrix((float *)&g_Projection);
|
|
||||||
|
|
||||||
g_pd3dDevice->IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
|
||||||
|
|
||||||
t = loop(t / 2.0f, 3.333333f);
|
t = loop(t / 2.0f, 3.333333f);
|
||||||
|
|
||||||
|
// animate and update all world transforms
|
||||||
for (int i = 0; i < m_descriptor->nodes_count; i++) {
|
for (int i = 0; i < m_descriptor->nodes_count; i++) {
|
||||||
node const& node = *m_descriptor->nodes[i];
|
node const& node = *m_descriptor->nodes[i];
|
||||||
node_instance& node_instance = m_nodeInstances[i];
|
node_instance& node_instance = m_nodeInstances[i];
|
||||||
|
|
||||||
animate_node(node, node_instance, t);
|
animate_node(node, node_instance, t);
|
||||||
node_world_transform(node, node_instance);
|
node_world_transform(node, node_instance);
|
||||||
|
}
|
||||||
|
|
||||||
g_pWorldVariable->SetMatrix((float *)&node_instance.world);
|
// update all lights (after world transforms are computed)
|
||||||
|
update_light_instances();
|
||||||
|
}
|
||||||
|
|
||||||
|
static int min(int a, int b)
|
||||||
|
{
|
||||||
|
return a < b ? a : b;
|
||||||
|
}
|
||||||
|
|
||||||
|
void scene_state::render()
|
||||||
|
{
|
||||||
|
XMFLOAT4 eye;
|
||||||
|
XMFLOAT4X4 projection;
|
||||||
|
XMFLOAT4X4 view;
|
||||||
|
XMStoreFloat4(&eye, g_Eye);
|
||||||
|
XMStoreFloat4x4(&view, g_View);
|
||||||
|
XMStoreFloat4x4(&projection, g_Projection);
|
||||||
|
|
||||||
|
g_pViewVariable->SetMatrix((float *)&view);
|
||||||
|
g_pProjectionVariable->SetMatrix((float *)&projection);
|
||||||
|
|
||||||
|
g_pViewEyeVariable->SetFloatVector((float *)&eye);
|
||||||
|
|
||||||
|
int lights = min(2, m_lightInstancesCount);
|
||||||
|
g_pLightPosVariable->SetFloatVectorArray((float *)m_lightPositions, 0, lights);
|
||||||
|
g_pLightDirVariable->SetFloatVectorArray((float *)m_lightDirections, 0, lights);
|
||||||
|
g_pLightColorVariable->SetFloatVectorArray((float *)m_lightColors, 0, lights);
|
||||||
|
|
||||||
|
g_pd3dDevice->IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||||
|
|
||||||
|
for (int i = 0; i < m_descriptor->nodes_count; i++) {
|
||||||
|
node const& node = *m_descriptor->nodes[i];
|
||||||
|
node_instance& node_instance = m_nodeInstances[i];
|
||||||
|
|
||||||
// joints aren't rendered
|
// joints aren't rendered
|
||||||
if (node.type != node_type::NODE)
|
if (node.type != node_type::NODE)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
g_pWorldVariable->SetMatrix((float *)&node_instance.world);
|
||||||
|
|
||||||
render_geometries(node.instance_geometries, node.instance_geometries_count);
|
render_geometries(node.instance_geometries, node.instance_geometries_count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,12 @@ cbuffer cbEveryFrame
|
|||||||
{
|
{
|
||||||
matrix View;
|
matrix View;
|
||||||
matrix Projection;
|
matrix Projection;
|
||||||
|
|
||||||
|
float4 ViewEye;
|
||||||
|
|
||||||
|
float4 LightPos[2];
|
||||||
|
float4 LightDir[2];
|
||||||
|
float4 LightColor[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
cbuffer cbMultiplePerFrame
|
cbuffer cbMultiplePerFrame
|
||||||
@ -30,30 +36,39 @@ struct PS_INPUT
|
|||||||
float4 Pos : SV_POSITION;
|
float4 Pos : SV_POSITION;
|
||||||
float3 Norm : NORMAL;
|
float3 Norm : NORMAL;
|
||||||
float2 Tex : TEXCOORD0;
|
float2 Tex : TEXCOORD0;
|
||||||
|
float4 WPos : POSITION;
|
||||||
};
|
};
|
||||||
|
|
||||||
PS_INPUT VS(VS_INPUT input)
|
PS_INPUT VS(VS_INPUT input)
|
||||||
{
|
{
|
||||||
PS_INPUT output;
|
PS_INPUT output;
|
||||||
|
|
||||||
output.Pos = mul(float4(input.Pos, 1), World);
|
float4 world_pos = mul(float4(input.Pos, 1), World);
|
||||||
output.Pos = mul(output.Pos, View);
|
output.Pos = mul(world_pos, View);
|
||||||
output.Pos = mul(output.Pos, Projection);
|
output.Pos = mul(output.Pos, Projection);
|
||||||
|
|
||||||
output.Norm = mul(input.Norm, (float3x3)World);
|
output.Norm = mul(input.Norm, (float3x3)World);
|
||||||
output.Tex = input.Tex;
|
output.Tex = input.Tex;
|
||||||
|
|
||||||
|
output.WPos = world_pos;
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
float4 PS(PS_INPUT input) : SV_Target
|
float4 PS(PS_INPUT input) : SV_Target
|
||||||
{
|
{
|
||||||
float4 color = Emission + Diffuse * 1.0 + Specular * 0.0;
|
float3 normal = normalize(input.Norm);
|
||||||
|
float3 view_dir = normalize(ViewEye.xyz - input.Pos.xyz);
|
||||||
|
|
||||||
|
float3 color = Emission.xyz;
|
||||||
|
|
||||||
|
for (int i = 0; i < 2; i++) {
|
||||||
|
float3 light_dir = normalize(-LightDir[i].xyz);
|
||||||
|
float diffuse_intensity = max(dot(normal, light_dir), 0.0);
|
||||||
|
color += Diffuse.xyz * diffuse_intensity * LightColor[i].xyz;
|
||||||
|
}
|
||||||
|
|
||||||
return float4(color.xyz, 1);
|
return float4(color.xyz, 1);
|
||||||
|
|
||||||
//return float4(input.Normal * 0.5 + 0.5, 1);
|
|
||||||
//return float4(input.Tex.xy, 0, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BlendState DisableBlending
|
BlendState DisableBlending
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
#include "collada.hpp"
|
#include "collada.hpp"
|
||||||
#include "collada_scene.hpp"
|
#include "collada_scene.hpp"
|
||||||
|
|
||||||
#include "scenes/curve_interpolation.hpp"
|
#include "scenes/curve_interpolation/curve_interpolation.hpp"
|
||||||
|
|
||||||
HINSTANCE g_hInstance = NULL;
|
HINSTANCE g_hInstance = NULL;
|
||||||
HWND g_hWnd = NULL;
|
HWND g_hWnd = NULL;
|
||||||
@ -1843,7 +1843,8 @@ void Render(float t, float dt)
|
|||||||
|
|
||||||
//collada::Render(t);
|
//collada::Render(t);
|
||||||
|
|
||||||
g_SceneState.render(t);
|
g_SceneState.update(t);
|
||||||
|
g_SceneState.render();
|
||||||
|
|
||||||
RenderFont(dt);
|
RenderFont(dt);
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,16 @@ namespace curve_interpolation {
|
|||||||
|
|
||||||
using namespace collada;
|
using namespace collada;
|
||||||
|
|
||||||
|
light const light_environmentambientlight = {
|
||||||
|
.type = light_type::AMBIENT,
|
||||||
|
.color = { 0.0f, 0.0f, 0.0f },
|
||||||
|
};
|
||||||
|
|
||||||
|
light const light_light_light = {
|
||||||
|
.type = light_type::DIRECTIONAL,
|
||||||
|
.color = { 1.0f, 1.0f, 1.0f },
|
||||||
|
};
|
||||||
|
|
||||||
float const array_node_cube_translation_x_input_array[] = {
|
float const array_node_cube_translation_x_input_array[] = {
|
||||||
0.0f,
|
0.0f,
|
||||||
1.666667f,
|
1.666667f,
|
||||||
@ -140,7 +150,7 @@ sampler const sampler_node_cube_translation_y_sampler = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
float const array_node_torus001_rotationx_angle_input_array[] = {
|
float const array_node_torus_rotationx_angle_input_array[] = {
|
||||||
0.0f,
|
0.0f,
|
||||||
0.8333334f,
|
0.8333334f,
|
||||||
1.666667f,
|
1.666667f,
|
||||||
@ -148,7 +158,7 @@ float const array_node_torus001_rotationx_angle_input_array[] = {
|
|||||||
3.333333f,
|
3.333333f,
|
||||||
};
|
};
|
||||||
|
|
||||||
float const array_node_torus001_rotationx_angle_output_array[] = {
|
float const array_node_torus_rotationx_angle_output_array[] = {
|
||||||
0.0f,
|
0.0f,
|
||||||
-90.0f,
|
-90.0f,
|
||||||
-180.0f,
|
-180.0f,
|
||||||
@ -156,7 +166,7 @@ float const array_node_torus001_rotationx_angle_output_array[] = {
|
|||||||
-360.0f,
|
-360.0f,
|
||||||
};
|
};
|
||||||
|
|
||||||
float const array_node_torus001_rotationx_angle_intangent_array[] = {
|
float const array_node_torus_rotationx_angle_intangent_array[] = {
|
||||||
0.9997917f, 0.0f,
|
0.9997917f, 0.0f,
|
||||||
0.3270486f, -89.70257f,
|
0.3270486f, -89.70257f,
|
||||||
0.9961964f, -179.1937f,
|
0.9961964f, -179.1937f,
|
||||||
@ -164,7 +174,7 @@ float const array_node_torus001_rotationx_angle_intangent_array[] = {
|
|||||||
2.6534f, -360.0f,
|
2.6534f, -360.0f,
|
||||||
};
|
};
|
||||||
|
|
||||||
float const array_node_torus001_rotationx_angle_outtangent_array[] = {
|
float const array_node_torus_rotationx_angle_outtangent_array[] = {
|
||||||
0.6602973f, 0.0f,
|
0.6602973f, 0.0f,
|
||||||
1.324714f, -90.28867f,
|
1.324714f, -90.28867f,
|
||||||
2.332406f, -180.8006f,
|
2.332406f, -180.8006f,
|
||||||
@ -172,7 +182,7 @@ float const array_node_torus001_rotationx_angle_outtangent_array[] = {
|
|||||||
2.333542f, -360.0f,
|
2.333542f, -360.0f,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum interpolation const array_node_torus001_rotationx_angle_interpolation_array[] = {
|
enum interpolation const array_node_torus_rotationx_angle_interpolation_array[] = {
|
||||||
interpolation::BEZIER,
|
interpolation::BEZIER,
|
||||||
interpolation::BEZIER,
|
interpolation::BEZIER,
|
||||||
interpolation::BEZIER,
|
interpolation::BEZIER,
|
||||||
@ -180,175 +190,175 @@ enum interpolation const array_node_torus001_rotationx_angle_interpolation_array
|
|||||||
interpolation::BEZIER,
|
interpolation::BEZIER,
|
||||||
};
|
};
|
||||||
|
|
||||||
sampler const sampler_node_torus001_rotationx_angle_sampler = {
|
sampler const sampler_node_torus_rotationx_angle_sampler = {
|
||||||
// node_torus001_rotationx_angle_input
|
// node_torus_rotationx_angle_input
|
||||||
.input = {
|
.input = {
|
||||||
.float_array = array_node_torus001_rotationx_angle_input_array,
|
.float_array = array_node_torus_rotationx_angle_input_array,
|
||||||
.count = 5,
|
.count = 5,
|
||||||
.stride = 1,
|
.stride = 1,
|
||||||
},
|
},
|
||||||
// node_torus001_rotationx_angle_output
|
// node_torus_rotationx_angle_output
|
||||||
.output = {
|
.output = {
|
||||||
.float_array = array_node_torus001_rotationx_angle_output_array,
|
.float_array = array_node_torus_rotationx_angle_output_array,
|
||||||
.count = 5,
|
.count = 5,
|
||||||
.stride = 1,
|
.stride = 1,
|
||||||
},
|
},
|
||||||
// node_torus001_rotationx_angle_intangent
|
// node_torus_rotationx_angle_intangent
|
||||||
.in_tangent = {
|
.in_tangent = {
|
||||||
.float_array = array_node_torus001_rotationx_angle_intangent_array,
|
.float_array = array_node_torus_rotationx_angle_intangent_array,
|
||||||
.count = 5,
|
.count = 5,
|
||||||
.stride = 2,
|
.stride = 2,
|
||||||
},
|
},
|
||||||
// node_torus001_rotationx_angle_outtangent
|
// node_torus_rotationx_angle_outtangent
|
||||||
.out_tangent = {
|
.out_tangent = {
|
||||||
.float_array = array_node_torus001_rotationx_angle_outtangent_array,
|
.float_array = array_node_torus_rotationx_angle_outtangent_array,
|
||||||
.count = 5,
|
.count = 5,
|
||||||
.stride = 2,
|
.stride = 2,
|
||||||
},
|
},
|
||||||
// node_torus001_rotationx_angle_interpolation
|
// node_torus_rotationx_angle_interpolation
|
||||||
.interpolation = {
|
.interpolation = {
|
||||||
.interpolation_array = array_node_torus001_rotationx_angle_interpolation_array,
|
.interpolation_array = array_node_torus_rotationx_angle_interpolation_array,
|
||||||
.count = 5,
|
.count = 5,
|
||||||
.stride = 1,
|
.stride = 1,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
float const array_node_geosphere001_scale_input_array[] = {
|
float const array_node_geosphere_scale_input_array[] = {
|
||||||
0.0f,
|
0.0f,
|
||||||
1.666667f,
|
1.666667f,
|
||||||
3.333333f,
|
3.333333f,
|
||||||
};
|
};
|
||||||
|
|
||||||
float const array_node_geosphere001_scale_output_array[] = {
|
float const array_node_geosphere_scale_output_array[] = {
|
||||||
1.0f, 1.0f, 1.0f,
|
1.0f, 1.0f, 1.0f,
|
||||||
1.996525f, 1.996525f, 1.996525f,
|
1.996525f, 1.996525f, 1.996525f,
|
||||||
1.0f, 1.0f, 1.0f,
|
1.0f, 1.0f, 1.0f,
|
||||||
};
|
};
|
||||||
|
|
||||||
float const array_node_geosphere001_scale_intangent_array[] = {
|
float const array_node_geosphere_scale_intangent_array[] = {
|
||||||
0.9997917f, 1.0f, 0.9997917f, 1.0f, 0.9997917f, 1.0f,
|
0.9997917f, 1.0f, 0.9997917f, 1.0f, 0.9997917f, 1.0f,
|
||||||
1.111167f, 1.996525f, 1.111167f, 1.996525f, 1.111167f, 1.996525f,
|
1.111167f, 1.996525f, 1.111167f, 1.996525f, 1.111167f, 1.996525f,
|
||||||
2.777833f, 1.0f, 2.777833f, 1.0f, 2.777833f, 1.0f,
|
2.777833f, 1.0f, 2.777833f, 1.0f, 2.777833f, 1.0f,
|
||||||
};
|
};
|
||||||
|
|
||||||
float const array_node_geosphere001_scale_outtangent_array[] = {
|
float const array_node_geosphere_scale_outtangent_array[] = {
|
||||||
0.5555f, 1.0f, 0.5555f, 1.0f, 0.5555f, 1.0f,
|
0.5555f, 1.0f, 0.5555f, 1.0f, 0.5555f, 1.0f,
|
||||||
2.222167f, 1.996525f, 2.222167f, 1.996525f, 2.222167f, 1.996525f,
|
2.222167f, 1.996525f, 2.222167f, 1.996525f, 2.222167f, 1.996525f,
|
||||||
2.333542f, 1.0f, 2.333542f, 1.0f, 2.333542f, 1.0f,
|
2.333542f, 1.0f, 2.333542f, 1.0f, 2.333542f, 1.0f,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum interpolation const array_node_geosphere001_scale_interpolation_array[] = {
|
enum interpolation const array_node_geosphere_scale_interpolation_array[] = {
|
||||||
interpolation::BEZIER,
|
interpolation::BEZIER,
|
||||||
interpolation::BEZIER,
|
interpolation::BEZIER,
|
||||||
interpolation::BEZIER,
|
interpolation::BEZIER,
|
||||||
};
|
};
|
||||||
|
|
||||||
sampler const sampler_node_geosphere001_scale_sampler = {
|
sampler const sampler_node_geosphere_scale_sampler = {
|
||||||
// node_geosphere001_scale_input
|
// node_geosphere_scale_input
|
||||||
.input = {
|
.input = {
|
||||||
.float_array = array_node_geosphere001_scale_input_array,
|
.float_array = array_node_geosphere_scale_input_array,
|
||||||
.count = 3,
|
.count = 3,
|
||||||
.stride = 1,
|
.stride = 1,
|
||||||
},
|
},
|
||||||
// node_geosphere001_scale_output
|
// node_geosphere_scale_output
|
||||||
.output = {
|
.output = {
|
||||||
.float_array = array_node_geosphere001_scale_output_array,
|
.float_array = array_node_geosphere_scale_output_array,
|
||||||
.count = 3,
|
.count = 3,
|
||||||
.stride = 3,
|
.stride = 3,
|
||||||
},
|
},
|
||||||
// node_geosphere001_scale_intangent
|
// node_geosphere_scale_intangent
|
||||||
.in_tangent = {
|
.in_tangent = {
|
||||||
.float_array = array_node_geosphere001_scale_intangent_array,
|
.float_array = array_node_geosphere_scale_intangent_array,
|
||||||
.count = 3,
|
.count = 3,
|
||||||
.stride = 6,
|
.stride = 6,
|
||||||
},
|
},
|
||||||
// node_geosphere001_scale_outtangent
|
// node_geosphere_scale_outtangent
|
||||||
.out_tangent = {
|
.out_tangent = {
|
||||||
.float_array = array_node_geosphere001_scale_outtangent_array,
|
.float_array = array_node_geosphere_scale_outtangent_array,
|
||||||
.count = 3,
|
.count = 3,
|
||||||
.stride = 6,
|
.stride = 6,
|
||||||
},
|
},
|
||||||
// node_geosphere001_scale_interpolation
|
// node_geosphere_scale_interpolation
|
||||||
.interpolation = {
|
.interpolation = {
|
||||||
.interpolation_array = array_node_geosphere001_scale_interpolation_array,
|
.interpolation_array = array_node_geosphere_scale_interpolation_array,
|
||||||
.count = 3,
|
.count = 3,
|
||||||
.stride = 1,
|
.stride = 1,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
float const array_node_geosphere001_inversescaleaxisrotation_input_array[] = {
|
float const array_node_geosphere_inversescaleaxisrotation_input_array[] = {
|
||||||
0.0f,
|
0.0f,
|
||||||
1.666667f,
|
1.666667f,
|
||||||
3.333333f,
|
3.333333f,
|
||||||
};
|
};
|
||||||
|
|
||||||
float const array_node_geosphere001_inversescaleaxisrotation_output_array[] = {
|
float const array_node_geosphere_inversescaleaxisrotation_output_array[] = {
|
||||||
0.0f, 0.0f, 0.0f, 0.0f,
|
0.0f, 0.0f, 0.0f, 0.0f,
|
||||||
0.0f, 0.0f, 0.0f, 0.0f,
|
0.0f, 0.0f, 0.0f, 0.0f,
|
||||||
0.0f, 0.0f, 0.0f, 0.0f,
|
0.0f, 0.0f, 0.0f, 0.0f,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum interpolation const array_node_geosphere001_inversescaleaxisrotation_interpolation_array[] = {
|
enum interpolation const array_node_geosphere_inversescaleaxisrotation_interpolation_array[] = {
|
||||||
interpolation::LINEAR,
|
interpolation::LINEAR,
|
||||||
interpolation::LINEAR,
|
interpolation::LINEAR,
|
||||||
interpolation::LINEAR,
|
interpolation::LINEAR,
|
||||||
};
|
};
|
||||||
|
|
||||||
sampler const sampler_node_geosphere001_inversescaleaxisrotation_sampler = {
|
sampler const sampler_node_geosphere_inversescaleaxisrotation_sampler = {
|
||||||
// node_geosphere001_inversescaleaxisrotation_input
|
// node_geosphere_inversescaleaxisrotation_input
|
||||||
.input = {
|
.input = {
|
||||||
.float_array = array_node_geosphere001_inversescaleaxisrotation_input_array,
|
.float_array = array_node_geosphere_inversescaleaxisrotation_input_array,
|
||||||
.count = 3,
|
.count = 3,
|
||||||
.stride = 1,
|
.stride = 1,
|
||||||
},
|
},
|
||||||
// node_geosphere001_inversescaleaxisrotation_output
|
// node_geosphere_inversescaleaxisrotation_output
|
||||||
.output = {
|
.output = {
|
||||||
.float_array = array_node_geosphere001_inversescaleaxisrotation_output_array,
|
.float_array = array_node_geosphere_inversescaleaxisrotation_output_array,
|
||||||
.count = 3,
|
.count = 3,
|
||||||
.stride = 4,
|
.stride = 4,
|
||||||
},
|
},
|
||||||
// node_geosphere001_inversescaleaxisrotation_interpolation
|
// node_geosphere_inversescaleaxisrotation_interpolation
|
||||||
.interpolation = {
|
.interpolation = {
|
||||||
.interpolation_array = array_node_geosphere001_inversescaleaxisrotation_interpolation_array,
|
.interpolation_array = array_node_geosphere_inversescaleaxisrotation_interpolation_array,
|
||||||
.count = 3,
|
.count = 3,
|
||||||
.stride = 1,
|
.stride = 1,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
float const array_node_geosphere001_scaleaxisrotation_input_array[] = {
|
float const array_node_geosphere_scaleaxisrotation_input_array[] = {
|
||||||
0.0f,
|
0.0f,
|
||||||
1.666667f,
|
1.666667f,
|
||||||
3.333333f,
|
3.333333f,
|
||||||
};
|
};
|
||||||
|
|
||||||
float const array_node_geosphere001_scaleaxisrotation_output_array[] = {
|
float const array_node_geosphere_scaleaxisrotation_output_array[] = {
|
||||||
0.0f, 0.0f, 0.0f, 0.0f,
|
0.0f, 0.0f, 0.0f, 0.0f,
|
||||||
0.0f, 0.0f, 0.0f, 0.0f,
|
0.0f, 0.0f, 0.0f, 0.0f,
|
||||||
0.0f, 0.0f, 0.0f, 0.0f,
|
0.0f, 0.0f, 0.0f, 0.0f,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum interpolation const array_node_geosphere001_scaleaxisrotation_interpolation_array[] = {
|
enum interpolation const array_node_geosphere_scaleaxisrotation_interpolation_array[] = {
|
||||||
interpolation::LINEAR,
|
interpolation::LINEAR,
|
||||||
interpolation::LINEAR,
|
interpolation::LINEAR,
|
||||||
interpolation::LINEAR,
|
interpolation::LINEAR,
|
||||||
};
|
};
|
||||||
|
|
||||||
sampler const sampler_node_geosphere001_scaleaxisrotation_sampler = {
|
sampler const sampler_node_geosphere_scaleaxisrotation_sampler = {
|
||||||
// node_geosphere001_scaleaxisrotation_input
|
// node_geosphere_scaleaxisrotation_input
|
||||||
.input = {
|
.input = {
|
||||||
.float_array = array_node_geosphere001_scaleaxisrotation_input_array,
|
.float_array = array_node_geosphere_scaleaxisrotation_input_array,
|
||||||
.count = 3,
|
.count = 3,
|
||||||
.stride = 1,
|
.stride = 1,
|
||||||
},
|
},
|
||||||
// node_geosphere001_scaleaxisrotation_output
|
// node_geosphere_scaleaxisrotation_output
|
||||||
.output = {
|
.output = {
|
||||||
.float_array = array_node_geosphere001_scaleaxisrotation_output_array,
|
.float_array = array_node_geosphere_scaleaxisrotation_output_array,
|
||||||
.count = 3,
|
.count = 3,
|
||||||
.stride = 4,
|
.stride = 4,
|
||||||
},
|
},
|
||||||
// node_geosphere001_scaleaxisrotation_interpolation
|
// node_geosphere_scaleaxisrotation_interpolation
|
||||||
.interpolation = {
|
.interpolation = {
|
||||||
.interpolation_array = array_node_geosphere001_scaleaxisrotation_interpolation_array,
|
.interpolation_array = array_node_geosphere_scaleaxisrotation_interpolation_array,
|
||||||
.count = 3,
|
.count = 3,
|
||||||
.stride = 1,
|
.stride = 1,
|
||||||
},
|
},
|
||||||
@ -366,27 +376,27 @@ channel const node_channel_node_cube_translation_y = {
|
|||||||
.target_attribute = target_attribute::Y,
|
.target_attribute = target_attribute::Y,
|
||||||
};
|
};
|
||||||
|
|
||||||
channel const node_channel_node_torus001_rotationx_angle = {
|
channel const node_channel_node_torus_rotationx_angle = {
|
||||||
.source_sampler = &sampler_node_torus001_rotationx_angle_sampler,
|
.source_sampler = &sampler_node_torus_rotationx_angle_sampler,
|
||||||
.target_transform_index = 3,
|
.target_transform_index = 3,
|
||||||
.target_attribute = target_attribute::ANGLE,
|
.target_attribute = target_attribute::ANGLE,
|
||||||
};
|
};
|
||||||
|
|
||||||
channel const node_channel_node_geosphere001_scale = {
|
channel const node_channel_node_geosphere_scale = {
|
||||||
.source_sampler = &sampler_node_geosphere001_scale_sampler,
|
.source_sampler = &sampler_node_geosphere_scale_sampler,
|
||||||
.target_transform_index = 2,
|
|
||||||
.target_attribute = target_attribute::ALL,
|
|
||||||
};
|
|
||||||
|
|
||||||
channel const node_channel_node_geosphere001_inversescaleaxisrotation = {
|
|
||||||
.source_sampler = &sampler_node_geosphere001_inversescaleaxisrotation_sampler,
|
|
||||||
.target_transform_index = 1,
|
.target_transform_index = 1,
|
||||||
.target_attribute = target_attribute::ALL,
|
.target_attribute = target_attribute::ALL,
|
||||||
};
|
};
|
||||||
|
|
||||||
channel const node_channel_node_geosphere001_scaleaxisrotation = {
|
channel const node_channel_node_geosphere_inversescaleaxisrotation = {
|
||||||
.source_sampler = &sampler_node_geosphere001_scaleaxisrotation_sampler,
|
.source_sampler = &sampler_node_geosphere_inversescaleaxisrotation_sampler,
|
||||||
.target_transform_index = 3,
|
.target_transform_index = 0,
|
||||||
|
.target_attribute = target_attribute::ALL,
|
||||||
|
};
|
||||||
|
|
||||||
|
channel const node_channel_node_geosphere_scaleaxisrotation = {
|
||||||
|
.source_sampler = &sampler_node_geosphere_scaleaxisrotation_sampler,
|
||||||
|
.target_transform_index = 2,
|
||||||
.target_attribute = target_attribute::ALL,
|
.target_attribute = target_attribute::ALL,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -670,6 +680,34 @@ effect const effect_coloreffectr198g224b87 = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
effect const effect_lightemit = {
|
||||||
|
.type = effect_type::BLINN,
|
||||||
|
.blinn = {
|
||||||
|
.emission = {
|
||||||
|
.color = {1.0f, 1.0f, 1.0f, 1.0f},
|
||||||
|
},
|
||||||
|
.ambient = {
|
||||||
|
.color = {0.0f, 0.0f, 0.0f, 1.0f},
|
||||||
|
},
|
||||||
|
.diffuse = {
|
||||||
|
.color = {0.0f, 0.0f, 0.0f, 1.0f},
|
||||||
|
},
|
||||||
|
.specular = {
|
||||||
|
.color = {0.0f, 0.0f, 0.0f, 1.0f},
|
||||||
|
},
|
||||||
|
.shininess = 10.0f,
|
||||||
|
.reflective = {
|
||||||
|
.color = {0.0f, 0.0f, 0.0f, 1.0f},
|
||||||
|
},
|
||||||
|
.reflectivity = 0.0f,
|
||||||
|
.transparent = {
|
||||||
|
.color = {1.0f, 1.0f, 1.0f, 1.0f},
|
||||||
|
},
|
||||||
|
.transparency = 1.0f,
|
||||||
|
.index_of_refraction = 0.0f,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
material const material_coloreffectr26g177b26_material = {
|
material const material_coloreffectr26g177b26_material = {
|
||||||
.effect = &effect_coloreffectr26g177b26,
|
.effect = &effect_coloreffectr26g177b26,
|
||||||
};
|
};
|
||||||
@ -710,6 +748,10 @@ material const material_material__20_material = {
|
|||||||
.effect = &effect_material__20,
|
.effect = &effect_material__20,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
material const material_lightemit_material = {
|
||||||
|
.effect = &effect_lightemit,
|
||||||
|
};
|
||||||
|
|
||||||
input_element const input_elements_position_0_3_normal_0_3_texcoord_0_3[] = {
|
input_element const input_elements_position_0_3_normal_0_3_texcoord_0_3[] = {
|
||||||
{
|
{
|
||||||
.semantic = "POSITION",
|
.semantic = "POSITION",
|
||||||
@ -774,7 +816,7 @@ geometry const geometry_geom_cube = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
triangles const triangles_geom_torus001[] = {
|
triangles const triangles_geom_torus[] = {
|
||||||
{
|
{
|
||||||
.count = 240, // triangles
|
.count = 240, // triangles
|
||||||
.index_offset = 0, // indices
|
.index_offset = 0, // indices
|
||||||
@ -782,9 +824,9 @@ triangles const triangles_geom_torus001[] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
geometry const geometry_geom_torus001 = {
|
geometry const geometry_geom_torus = {
|
||||||
.mesh = {
|
.mesh = {
|
||||||
.triangles = triangles_geom_torus001,
|
.triangles = triangles_geom_torus,
|
||||||
.triangles_count = 1,
|
.triangles_count = 1,
|
||||||
|
|
||||||
.vertex_buffer_offset = 864,
|
.vertex_buffer_offset = 864,
|
||||||
@ -795,7 +837,7 @@ geometry const geometry_geom_torus001 = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
triangles const triangles_geom_cylinder001[] = {
|
triangles const triangles_geom_cylinder[] = {
|
||||||
{
|
{
|
||||||
.count = 30, // triangles
|
.count = 30, // triangles
|
||||||
.index_offset = 0, // indices
|
.index_offset = 0, // indices
|
||||||
@ -803,9 +845,9 @@ triangles const triangles_geom_cylinder001[] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
geometry const geometry_geom_cylinder001 = {
|
geometry const geometry_geom_cylinder = {
|
||||||
.mesh = {
|
.mesh = {
|
||||||
.triangles = triangles_geom_cylinder001,
|
.triangles = triangles_geom_cylinder,
|
||||||
.triangles_count = 1,
|
.triangles_count = 1,
|
||||||
|
|
||||||
.vertex_buffer_offset = 6012,
|
.vertex_buffer_offset = 6012,
|
||||||
@ -816,7 +858,7 @@ geometry const geometry_geom_cylinder001 = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
triangles const triangles_geom_plane001[] = {
|
triangles const triangles_geom_plane[] = {
|
||||||
{
|
{
|
||||||
.count = 2, // triangles
|
.count = 2, // triangles
|
||||||
.index_offset = 0, // indices
|
.index_offset = 0, // indices
|
||||||
@ -824,9 +866,9 @@ triangles const triangles_geom_plane001[] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
geometry const geometry_geom_plane001 = {
|
geometry const geometry_geom_plane = {
|
||||||
.mesh = {
|
.mesh = {
|
||||||
.triangles = triangles_geom_plane001,
|
.triangles = triangles_geom_plane,
|
||||||
.triangles_count = 1,
|
.triangles_count = 1,
|
||||||
|
|
||||||
.vertex_buffer_offset = 7164,
|
.vertex_buffer_offset = 7164,
|
||||||
@ -837,7 +879,7 @@ geometry const geometry_geom_plane001 = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
triangles const triangles_geom_geosphere001[] = {
|
triangles const triangles_geom_geosphere[] = {
|
||||||
{
|
{
|
||||||
.count = 40, // triangles
|
.count = 40, // triangles
|
||||||
.index_offset = 0, // indices
|
.index_offset = 0, // indices
|
||||||
@ -845,9 +887,9 @@ triangles const triangles_geom_geosphere001[] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
geometry const geometry_geom_geosphere001 = {
|
geometry const geometry_geom_geosphere = {
|
||||||
.mesh = {
|
.mesh = {
|
||||||
.triangles = triangles_geom_geosphere001,
|
.triangles = triangles_geom_geosphere,
|
||||||
.triangles_count = 1,
|
.triangles_count = 1,
|
||||||
|
|
||||||
.vertex_buffer_offset = 7308,
|
.vertex_buffer_offset = 7308,
|
||||||
@ -858,12 +900,34 @@ geometry const geometry_geom_geosphere001 = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
triangles const triangles_geom_lightindicator[] = {
|
||||||
|
{
|
||||||
|
.count = 8, // triangles
|
||||||
|
.index_offset = 0, // indices
|
||||||
|
.inputs_index = 0, // index into inputs_list
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
geometry const geometry_geom_lightindicator = {
|
||||||
|
.mesh = {
|
||||||
|
.triangles = triangles_geom_lightindicator,
|
||||||
|
.triangles_count = 1,
|
||||||
|
|
||||||
|
.vertex_buffer_offset = 11628,
|
||||||
|
.vertex_buffer_size = 864,
|
||||||
|
|
||||||
|
.index_buffer_offset = 3888,
|
||||||
|
.index_buffer_size = 96,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
geometry const * const geometries[] = {
|
geometry const * const geometries[] = {
|
||||||
&geometry_geom_cube,
|
&geometry_geom_cube,
|
||||||
&geometry_geom_torus001,
|
&geometry_geom_torus,
|
||||||
&geometry_geom_cylinder001,
|
&geometry_geom_cylinder,
|
||||||
&geometry_geom_plane001,
|
&geometry_geom_plane,
|
||||||
&geometry_geom_geosphere001,
|
&geometry_geom_geosphere,
|
||||||
|
&geometry_geom_lightindicator,
|
||||||
};
|
};
|
||||||
|
|
||||||
transform const transforms_node_environmentambientlight[] = {
|
transform const transforms_node_environmentambientlight[] = {
|
||||||
@ -872,6 +936,12 @@ transform const transforms_node_environmentambientlight[] = {
|
|||||||
instance_geometry const instance_geometries_node_environmentambientlight[] = {
|
instance_geometry const instance_geometries_node_environmentambientlight[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
instance_light const instance_lights_node_environmentambientlight[] = {
|
||||||
|
{
|
||||||
|
.light = &light_environmentambientlight,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
channel const * const node_channels_node_environmentambientlight[] = {};
|
channel const * const node_channels_node_environmentambientlight[] = {};
|
||||||
|
|
||||||
node const node_node_environmentambientlight = {
|
node const node_node_environmentambientlight = {
|
||||||
@ -885,6 +955,9 @@ node const node_node_environmentambientlight = {
|
|||||||
.instance_geometries = instance_geometries_node_environmentambientlight,
|
.instance_geometries = instance_geometries_node_environmentambientlight,
|
||||||
.instance_geometries_count = 0,
|
.instance_geometries_count = 0,
|
||||||
|
|
||||||
|
.instance_lights = instance_lights_node_environmentambientlight,
|
||||||
|
.instance_lights_count = 1,
|
||||||
|
|
||||||
.channels = node_channels_node_environmentambientlight,
|
.channels = node_channels_node_environmentambientlight,
|
||||||
.channels_count = 0,
|
.channels_count = 0,
|
||||||
};
|
};
|
||||||
@ -931,6 +1004,9 @@ instance_geometry const instance_geometries_node_cube[] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
instance_light const instance_lights_node_cube[] = {
|
||||||
|
};
|
||||||
|
|
||||||
channel const * const node_channels_node_cube[] = {
|
channel const * const node_channels_node_cube[] = {
|
||||||
&node_channel_node_cube_translation_y,
|
&node_channel_node_cube_translation_y,
|
||||||
&node_channel_node_cube_translation_x,
|
&node_channel_node_cube_translation_x,
|
||||||
@ -947,11 +1023,14 @@ node const node_node_cube = {
|
|||||||
.instance_geometries = instance_geometries_node_cube,
|
.instance_geometries = instance_geometries_node_cube,
|
||||||
.instance_geometries_count = 1,
|
.instance_geometries_count = 1,
|
||||||
|
|
||||||
|
.instance_lights = instance_lights_node_cube,
|
||||||
|
.instance_lights_count = 0,
|
||||||
|
|
||||||
.channels = node_channels_node_cube,
|
.channels = node_channels_node_cube,
|
||||||
.channels_count = 2,
|
.channels_count = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
transform const transforms_node_torus001[] = {
|
transform const transforms_node_torus[] = {
|
||||||
{
|
{
|
||||||
.type = transform_type::TRANSLATE,
|
.type = transform_type::TRANSLATE,
|
||||||
.translate = {5.0f, 1.14258e-07f, 2.0f},
|
.translate = {5.0f, 1.14258e-07f, 2.0f},
|
||||||
@ -974,77 +1053,89 @@ transform const transforms_node_torus001[] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
instance_material const instance_materials_node_torus001_0[] = {
|
instance_material const instance_materials_node_torus_0[] = {
|
||||||
{
|
{
|
||||||
.element_index = 0, // an index into mesh.triangles
|
.element_index = 0, // an index into mesh.triangles
|
||||||
.material = &material_coloreffectr26g177b26_material,
|
.material = &material_coloreffectr26g177b26_material,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
instance_geometry const instance_geometries_node_torus001[] = {
|
instance_geometry const instance_geometries_node_torus[] = {
|
||||||
{
|
{
|
||||||
.geometry = &geometry_geom_torus001,
|
.geometry = &geometry_geom_torus,
|
||||||
.instance_materials = instance_materials_node_torus001_0,
|
.instance_materials = instance_materials_node_torus_0,
|
||||||
.instance_materials_count = 1,
|
.instance_materials_count = 1,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
channel const * const node_channels_node_torus001[] = {
|
instance_light const instance_lights_node_torus[] = {
|
||||||
&node_channel_node_torus001_rotationx_angle,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
node const node_node_torus001 = {
|
channel const * const node_channels_node_torus[] = {
|
||||||
|
&node_channel_node_torus_rotationx_angle,
|
||||||
|
};
|
||||||
|
|
||||||
|
node const node_node_torus = {
|
||||||
.parent_index = 1,
|
.parent_index = 1,
|
||||||
|
|
||||||
.type = node_type::NODE,
|
.type = node_type::NODE,
|
||||||
|
|
||||||
.transforms = transforms_node_torus001,
|
.transforms = transforms_node_torus,
|
||||||
.transforms_count = 5,
|
.transforms_count = 5,
|
||||||
|
|
||||||
.instance_geometries = instance_geometries_node_torus001,
|
.instance_geometries = instance_geometries_node_torus,
|
||||||
.instance_geometries_count = 1,
|
.instance_geometries_count = 1,
|
||||||
|
|
||||||
.channels = node_channels_node_torus001,
|
.instance_lights = instance_lights_node_torus,
|
||||||
|
.instance_lights_count = 0,
|
||||||
|
|
||||||
|
.channels = node_channels_node_torus,
|
||||||
.channels_count = 1,
|
.channels_count = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
transform const transforms_node_cylinder001[] = {
|
transform const transforms_node_cylinder[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
instance_material const instance_materials_node_cylinder001_0[] = {
|
instance_material const instance_materials_node_cylinder_0[] = {
|
||||||
{
|
{
|
||||||
.element_index = 0, // an index into mesh.triangles
|
.element_index = 0, // an index into mesh.triangles
|
||||||
.material = &material_coloreffectr229g154b215_material,
|
.material = &material_coloreffectr229g154b215_material,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
instance_geometry const instance_geometries_node_cylinder001[] = {
|
instance_geometry const instance_geometries_node_cylinder[] = {
|
||||||
{
|
{
|
||||||
.geometry = &geometry_geom_cylinder001,
|
.geometry = &geometry_geom_cylinder,
|
||||||
.instance_materials = instance_materials_node_cylinder001_0,
|
.instance_materials = instance_materials_node_cylinder_0,
|
||||||
.instance_materials_count = 1,
|
.instance_materials_count = 1,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
channel const * const node_channels_node_cylinder001[] = {
|
instance_light const instance_lights_node_cylinder[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
node const node_node_cylinder001 = {
|
channel const * const node_channels_node_cylinder[] = {
|
||||||
|
};
|
||||||
|
|
||||||
|
node const node_node_cylinder = {
|
||||||
.parent_index = -1,
|
.parent_index = -1,
|
||||||
|
|
||||||
.type = node_type::NODE,
|
.type = node_type::NODE,
|
||||||
|
|
||||||
.transforms = transforms_node_cylinder001,
|
.transforms = transforms_node_cylinder,
|
||||||
.transforms_count = 0,
|
.transforms_count = 0,
|
||||||
|
|
||||||
.instance_geometries = instance_geometries_node_cylinder001,
|
.instance_geometries = instance_geometries_node_cylinder,
|
||||||
.instance_geometries_count = 1,
|
.instance_geometries_count = 1,
|
||||||
|
|
||||||
.channels = node_channels_node_cylinder001,
|
.instance_lights = instance_lights_node_cylinder,
|
||||||
|
.instance_lights_count = 0,
|
||||||
|
|
||||||
|
.channels = node_channels_node_cylinder,
|
||||||
.channels_count = 0,
|
.channels_count = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
transform const transforms_node_plane001[] = {
|
transform const transforms_node_plane[] = {
|
||||||
{
|
{
|
||||||
.type = transform_type::TRANSLATE,
|
.type = transform_type::TRANSLATE,
|
||||||
.translate = {0.0f, 0.0f, 0.01f},
|
.translate = {0.0f, 0.0f, 0.01f},
|
||||||
@ -1055,44 +1146,46 @@ transform const transforms_node_plane001[] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
instance_material const instance_materials_node_plane001_0[] = {
|
instance_material const instance_materials_node_plane_0[] = {
|
||||||
{
|
{
|
||||||
.element_index = 0, // an index into mesh.triangles
|
.element_index = 0, // an index into mesh.triangles
|
||||||
.material = &material_coloreffectr28g149b177_material,
|
.material = &material_coloreffectr28g149b177_material,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
instance_geometry const instance_geometries_node_plane001[] = {
|
instance_geometry const instance_geometries_node_plane[] = {
|
||||||
{
|
{
|
||||||
.geometry = &geometry_geom_plane001,
|
.geometry = &geometry_geom_plane,
|
||||||
.instance_materials = instance_materials_node_plane001_0,
|
.instance_materials = instance_materials_node_plane_0,
|
||||||
.instance_materials_count = 1,
|
.instance_materials_count = 1,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
channel const * const node_channels_node_plane001[] = {
|
instance_light const instance_lights_node_plane[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
node const node_node_plane001 = {
|
channel const * const node_channels_node_plane[] = {
|
||||||
|
};
|
||||||
|
|
||||||
|
node const node_node_plane = {
|
||||||
.parent_index = -1,
|
.parent_index = -1,
|
||||||
|
|
||||||
.type = node_type::NODE,
|
.type = node_type::NODE,
|
||||||
|
|
||||||
.transforms = transforms_node_plane001,
|
.transforms = transforms_node_plane,
|
||||||
.transforms_count = 2,
|
.transforms_count = 2,
|
||||||
|
|
||||||
.instance_geometries = instance_geometries_node_plane001,
|
.instance_geometries = instance_geometries_node_plane,
|
||||||
.instance_geometries_count = 1,
|
.instance_geometries_count = 1,
|
||||||
|
|
||||||
.channels = node_channels_node_plane001,
|
.instance_lights = instance_lights_node_plane,
|
||||||
|
.instance_lights_count = 0,
|
||||||
|
|
||||||
|
.channels = node_channels_node_plane,
|
||||||
.channels_count = 0,
|
.channels_count = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
transform const transforms_node_geosphere001[] = {
|
transform const transforms_node_geosphere[] = {
|
||||||
{
|
|
||||||
.type = transform_type::TRANSLATE,
|
|
||||||
.translate = {0.03164387f, -0.03838623f, 0.0f},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
.type = transform_type::ROTATE,
|
.type = transform_type::ROTATE,
|
||||||
.rotate = {0.0f, 0.0f, 0.0f, 0.0f},
|
.rotate = {0.0f, 0.0f, 0.0f, 0.0f},
|
||||||
@ -1107,49 +1200,140 @@ transform const transforms_node_geosphere001[] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
instance_material const instance_materials_node_geosphere001_0[] = {
|
instance_material const instance_materials_node_geosphere_0[] = {
|
||||||
{
|
{
|
||||||
.element_index = 0, // an index into mesh.triangles
|
.element_index = 0, // an index into mesh.triangles
|
||||||
.material = &material_coloreffectr198g224b87_material,
|
.material = &material_coloreffectr198g224b87_material,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
instance_geometry const instance_geometries_node_geosphere001[] = {
|
instance_geometry const instance_geometries_node_geosphere[] = {
|
||||||
{
|
{
|
||||||
.geometry = &geometry_geom_geosphere001,
|
.geometry = &geometry_geom_geosphere,
|
||||||
.instance_materials = instance_materials_node_geosphere001_0,
|
.instance_materials = instance_materials_node_geosphere_0,
|
||||||
.instance_materials_count = 1,
|
.instance_materials_count = 1,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
channel const * const node_channels_node_geosphere001[] = {
|
instance_light const instance_lights_node_geosphere[] = {
|
||||||
&node_channel_node_geosphere001_inversescaleaxisrotation,
|
|
||||||
&node_channel_node_geosphere001_scale,
|
|
||||||
&node_channel_node_geosphere001_scaleaxisrotation,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
node const node_node_geosphere001 = {
|
channel const * const node_channels_node_geosphere[] = {
|
||||||
|
&node_channel_node_geosphere_scale,
|
||||||
|
&node_channel_node_geosphere_inversescaleaxisrotation,
|
||||||
|
&node_channel_node_geosphere_scaleaxisrotation,
|
||||||
|
};
|
||||||
|
|
||||||
|
node const node_node_geosphere = {
|
||||||
.parent_index = -1,
|
.parent_index = -1,
|
||||||
|
|
||||||
.type = node_type::NODE,
|
.type = node_type::NODE,
|
||||||
|
|
||||||
.transforms = transforms_node_geosphere001,
|
.transforms = transforms_node_geosphere,
|
||||||
.transforms_count = 4,
|
.transforms_count = 3,
|
||||||
|
|
||||||
.instance_geometries = instance_geometries_node_geosphere001,
|
.instance_geometries = instance_geometries_node_geosphere,
|
||||||
.instance_geometries_count = 1,
|
.instance_geometries_count = 1,
|
||||||
|
|
||||||
.channels = node_channels_node_geosphere001,
|
.instance_lights = instance_lights_node_geosphere,
|
||||||
|
.instance_lights_count = 0,
|
||||||
|
|
||||||
|
.channels = node_channels_node_geosphere,
|
||||||
.channels_count = 3,
|
.channels_count = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
transform const transforms_node_light[] = {
|
||||||
|
{
|
||||||
|
.type = transform_type::TRANSLATE,
|
||||||
|
.translate = {2.124535f, 8.291501f, 6.185831f},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
instance_geometry const instance_geometries_node_light[] = {
|
||||||
|
};
|
||||||
|
|
||||||
|
instance_light const instance_lights_node_light[] = {
|
||||||
|
{
|
||||||
|
.light = &light_light_light,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
channel const * const node_channels_node_light[] = {
|
||||||
|
};
|
||||||
|
|
||||||
|
node const node_node_light = {
|
||||||
|
.parent_index = -1,
|
||||||
|
|
||||||
|
.type = node_type::NODE,
|
||||||
|
|
||||||
|
.transforms = transforms_node_light,
|
||||||
|
.transforms_count = 1,
|
||||||
|
|
||||||
|
.instance_geometries = instance_geometries_node_light,
|
||||||
|
.instance_geometries_count = 0,
|
||||||
|
|
||||||
|
.instance_lights = instance_lights_node_light,
|
||||||
|
.instance_lights_count = 1,
|
||||||
|
|
||||||
|
.channels = node_channels_node_light,
|
||||||
|
.channels_count = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
transform const transforms_node_lightindicator[] = {
|
||||||
|
{
|
||||||
|
.type = transform_type::ROTATE,
|
||||||
|
.rotate = {0.5773504f, -0.5773501f, -0.5773504f, -120.0f},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
instance_material const instance_materials_node_lightindicator_0[] = {
|
||||||
|
{
|
||||||
|
.element_index = 0, // an index into mesh.triangles
|
||||||
|
.material = &material_lightemit_material,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
instance_geometry const instance_geometries_node_lightindicator[] = {
|
||||||
|
{
|
||||||
|
.geometry = &geometry_geom_lightindicator,
|
||||||
|
.instance_materials = instance_materials_node_lightindicator_0,
|
||||||
|
.instance_materials_count = 1,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
instance_light const instance_lights_node_lightindicator[] = {
|
||||||
|
};
|
||||||
|
|
||||||
|
channel const * const node_channels_node_lightindicator[] = {
|
||||||
|
};
|
||||||
|
|
||||||
|
node const node_node_lightindicator = {
|
||||||
|
.parent_index = 6,
|
||||||
|
|
||||||
|
.type = node_type::NODE,
|
||||||
|
|
||||||
|
.transforms = transforms_node_lightindicator,
|
||||||
|
.transforms_count = 1,
|
||||||
|
|
||||||
|
.instance_geometries = instance_geometries_node_lightindicator,
|
||||||
|
.instance_geometries_count = 1,
|
||||||
|
|
||||||
|
.instance_lights = instance_lights_node_lightindicator,
|
||||||
|
.instance_lights_count = 0,
|
||||||
|
|
||||||
|
.channels = node_channels_node_lightindicator,
|
||||||
|
.channels_count = 0,
|
||||||
|
};
|
||||||
|
|
||||||
node const * const nodes[] = {
|
node const * const nodes[] = {
|
||||||
&node_node_environmentambientlight,
|
&node_node_environmentambientlight,
|
||||||
&node_node_cube,
|
&node_node_cube,
|
||||||
&node_node_torus001,
|
&node_node_torus,
|
||||||
&node_node_cylinder001,
|
&node_node_cylinder,
|
||||||
&node_node_plane001,
|
&node_node_plane,
|
||||||
&node_node_geosphere001,
|
&node_node_geosphere,
|
||||||
|
&node_node_light,
|
||||||
|
&node_node_lightindicator,
|
||||||
};
|
};
|
||||||
|
|
||||||
inputs const inputs_list[] = {
|
inputs const inputs_list[] = {
|
||||||
Loading…
x
Reference in New Issue
Block a user