RUIC 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY +23 -0
- data/README.md +2 -2
- data/lib/ruic.rb +11 -3
- data/lib/ruic/application.rb +28 -22
- data/lib/ruic/attributes.rb +10 -2
- data/lib/ruic/behaviors.rb +2 -15
- data/lib/ruic/effect.rb +32 -0
- data/lib/ruic/interfaces.rb +51 -13
- data/lib/ruic/presentation.rb +46 -20
- data/lib/ruic/renderplugin.rb +18 -0
- data/lib/ruic/ripl.rb +45 -0
- data/lib/ruic/statemachine.rb +142 -25
- data/lib/ruic/version.rb +1 -1
- data/test/customclasses.ruic +0 -1
- data/test/filtering.ruic +0 -1
- data/test/futureassets.ruic +0 -1
- data/test/nonmaster.ruic +0 -1
- data/test/paths.ruic +0 -2
- data/test/projects/MissingAssets/Existing.uip +87 -0
- data/test/projects/MissingAssets/MissingAssets.uia +21 -0
- data/test/projects/MissingAssets/MissingAssets.uia-user +14 -0
- data/test/projects/MissingAssets/RoundedPlane-1/RoundedPlane-1.import +18 -0
- data/test/projects/MissingAssets/RoundedPlane-1/meshes/RoundedPlane.mesh +0 -0
- data/test/projects/MissingAssets/effects/effects.txt +3 -0
- data/test/projects/MissingAssets/effects/existing.effect +38 -0
- data/test/projects/MissingAssets/fonts/Arimo-Regular.ttf +0 -0
- data/test/projects/MissingAssets/fonts/Chivo-Black.ttf +0 -0
- data/test/projects/MissingAssets/fonts/OFL.txt +92 -0
- data/test/projects/MissingAssets/maps/effects/brushnoise.dds +0 -0
- data/test/projects/MissingAssets/maps/existing.png +0 -0
- data/test/projects/MissingAssets/maps/existing2.png +0 -0
- data/test/projects/MissingAssets/maps/maps.txt +2 -0
- data/test/projects/MissingAssets/maps/materials/concrete_plain.png +0 -0
- data/test/projects/MissingAssets/maps/materials/concrete_plain_bump.png +0 -0
- data/test/projects/MissingAssets/maps/materials/spherical_checker.png +0 -0
- data/test/projects/MissingAssets/maps/unused.png +0 -0
- data/test/projects/MissingAssets/materials/concrete.material +251 -0
- data/test/projects/MissingAssets/materials/materials.txt +3 -0
- data/test/projects/MissingAssets/scripts/existing1.lua +2 -0
- data/test/projects/MissingAssets/scripts/existing2.lua +470 -0
- data/test/projects/MissingAssets/states/existing.scxml +4 -0
- data/test/projects/MissingAssets/tests/interface-navigation.scxml-test +3 -0
- data/test/properties.ruic +0 -2
- data/test/referencematerials.ruic +0 -2
- data/test/usage.ruic +38 -4
- metadata +53 -3
- data/lib/ruic/ripl-after-result.rb +0 -25
@@ -0,0 +1,14 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
+
<Project>
|
3
|
+
<UIADebug>
|
4
|
+
<Tab>
|
5
|
+
<Tab0>
|
6
|
+
<Item Name="Source" value="MissingAssets.uia"/>
|
7
|
+
<Item Name="Line" value="-1"/>
|
8
|
+
</Tab0>
|
9
|
+
<Highlight>
|
10
|
+
<Item Name="Index" value="0"/>
|
11
|
+
</Highlight>
|
12
|
+
</Tab>
|
13
|
+
</UIADebug>
|
14
|
+
</Project>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
+
<UIP Version="1" >
|
3
|
+
<Project Revision="1" >
|
4
|
+
<Graph >
|
5
|
+
<Group id="__import__root__" >
|
6
|
+
<Model id="RoundedPlane" name="RoundedPlane" orientation="Right Handed" position="0 0 -0" rotation="0 -0 0" rotationorder="XYZr" scale="1 1 1" sourcepath=".\meshes\RoundedPlane.mesh#1" >
|
7
|
+
<Material id="lambert2" name="lambert2" blendmode="Normal" diffuse="1 1 1" emissivepower="0" opacity="100" specularamount="0" />
|
8
|
+
</Model>
|
9
|
+
</Group>
|
10
|
+
</Graph>
|
11
|
+
<Import SrcFile="..\..\Program Files (x86)\NVIDIA Corporation\UI Composer 8.0\Content\Models Library\Primitives\Planes\RoundedPlane-1.dae" ImageDir="Images" MeshDir="Meshes" >
|
12
|
+
<Mesh >
|
13
|
+
<Source >RoundedPlane</Source>
|
14
|
+
<Dest >.\meshes\RoundedPlane.mesh</Dest>
|
15
|
+
</Mesh>
|
16
|
+
</Import>
|
17
|
+
</Project>
|
18
|
+
</UIP>
|
Binary file
|
@@ -0,0 +1,3 @@
|
|
1
|
+
This folder may be used to hold any layer effects that you add to your project.
|
2
|
+
|
3
|
+
You can find sample layer effects in the Effects Library supplied with Studio (accessible from the bottom of the Project palette). For more information on layer effects, see the documentation page "Applying Layer Effects" in the "Best Practices" section.
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
+
<Effect>
|
3
|
+
<MetaData>
|
4
|
+
<!--Simulates an artistic painting of the image-->
|
5
|
+
<Property name="NoiseSamp" formalName="Noise" filter="linear" clamp="repeat" type="Texture" default=".\maps\effects\brushnoise.dds" description="Texture to be used for the brush texture"/>
|
6
|
+
<Property name="brushAngle" formalName="Brush Angle" default="45" description="Amount to rotate the noise texture."/>
|
7
|
+
<Property name="brushLen" formalName="Stroke Length" min="0" max="3" default="1" description="How far to offset the image/'brush'."/>
|
8
|
+
<Property name="brushSize" formalName="Stroke Size" min="10" max="200" default="100" description="Scale the brush. (Smaller values yield larger sizes.)"/>
|
9
|
+
</MetaData>
|
10
|
+
<Shaders>
|
11
|
+
<Shader>
|
12
|
+
<FragmentShader>
|
13
|
+
void frag (void)
|
14
|
+
{
|
15
|
+
if ( flagNoiseSamp != 0 ) {
|
16
|
+
float alpha = radians(brushAngle);
|
17
|
+
float cosAlpha = cos(alpha);
|
18
|
+
float sinAlpha = sin(alpha);
|
19
|
+
mat2 rotMat = mat2(cosAlpha, sinAlpha, -sinAlpha, cosAlpha);
|
20
|
+
|
21
|
+
vec2 uv0 = TexCoord / brushSize * 1000.0;
|
22
|
+
uv0 = (uv0.yx * rotMat).yx;
|
23
|
+
|
24
|
+
vec2 uv1 = texture2D_NoiseSamp(fract(uv0)).xy - 0.5;
|
25
|
+
uv1*= vec2(1.0, 0.01);
|
26
|
+
uv1*= rotMat;
|
27
|
+
vec2 uv2 = TexCoord + uv1 * 0.1 * brushLen;
|
28
|
+
|
29
|
+
vec2 halfPixelSize = 0.5 / Texture0Info.xy;
|
30
|
+
colorOutput(texture2D_0(clamp(uv2, halfPixelSize, 1.0-halfPixelSize)));
|
31
|
+
}
|
32
|
+
else
|
33
|
+
colorOutput(texture2D_0(TexCoord));
|
34
|
+
}
|
35
|
+
</FragmentShader>
|
36
|
+
</Shader>
|
37
|
+
</Shaders>
|
38
|
+
</Effect>
|
Binary file
|
Binary file
|
@@ -0,0 +1,92 @@
|
|
1
|
+
Copyright (c) 2010, Google Corporation.
|
2
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
3
|
+
This license is copied below, and is also available with a FAQ at:
|
4
|
+
http://scripts.sil.org/OFL
|
5
|
+
|
6
|
+
|
7
|
+
-----------------------------------------------------------
|
8
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
9
|
+
-----------------------------------------------------------
|
10
|
+
|
11
|
+
PREAMBLE
|
12
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
13
|
+
development of collaborative font projects, to support the font creation
|
14
|
+
efforts of academic and linguistic communities, and to provide a free and
|
15
|
+
open framework in which fonts may be shared and improved in partnership
|
16
|
+
with others.
|
17
|
+
|
18
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
19
|
+
redistributed freely as long as they are not sold by themselves. The
|
20
|
+
fonts, including any derivative works, can be bundled, embedded,
|
21
|
+
redistributed and/or sold with any software provided that any reserved
|
22
|
+
names are not used by derivative works. The fonts and derivatives,
|
23
|
+
however, cannot be released under any other type of license. The
|
24
|
+
requirement for fonts to remain under this license does not apply
|
25
|
+
to any document created using the fonts or their derivatives.
|
26
|
+
|
27
|
+
DEFINITIONS
|
28
|
+
"Font Software" refers to the set of files released by the Copyright
|
29
|
+
Holder(s) under this license and clearly marked as such. This may
|
30
|
+
include source files, build scripts and documentation.
|
31
|
+
|
32
|
+
"Reserved Font Name" refers to any names specified as such after the
|
33
|
+
copyright statement(s).
|
34
|
+
|
35
|
+
"Original Version" refers to the collection of Font Software components as
|
36
|
+
distributed by the Copyright Holder(s).
|
37
|
+
|
38
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
39
|
+
or substituting -- in part or in whole -- any of the components of the
|
40
|
+
Original Version, by changing formats or by porting the Font Software to a
|
41
|
+
new environment.
|
42
|
+
|
43
|
+
"Author" refers to any designer, engineer, programmer, technical
|
44
|
+
writer or other person who contributed to the Font Software.
|
45
|
+
|
46
|
+
PERMISSION & CONDITIONS
|
47
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
48
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
49
|
+
redistribute, and sell modified and unmodified copies of the Font
|
50
|
+
Software, subject to the following conditions:
|
51
|
+
|
52
|
+
1) Neither the Font Software nor any of its individual components,
|
53
|
+
in Original or Modified Versions, may be sold by itself.
|
54
|
+
|
55
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
56
|
+
redistributed and/or sold with any software, provided that each copy
|
57
|
+
contains the above copyright notice and this license. These can be
|
58
|
+
included either as stand-alone text files, human-readable headers or
|
59
|
+
in the appropriate machine-readable metadata fields within text or
|
60
|
+
binary files as long as those fields can be easily viewed by the user.
|
61
|
+
|
62
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
63
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
64
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
65
|
+
presented to the users.
|
66
|
+
|
67
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
68
|
+
Software shall not be used to promote, endorse or advertise any
|
69
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
70
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
71
|
+
permission.
|
72
|
+
|
73
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
74
|
+
must be distributed entirely under this license, and must not be
|
75
|
+
distributed under any other license. The requirement for fonts to
|
76
|
+
remain under this license does not apply to any document created
|
77
|
+
using the Font Software.
|
78
|
+
|
79
|
+
TERMINATION
|
80
|
+
This license becomes null and void if any of the above conditions are
|
81
|
+
not met.
|
82
|
+
|
83
|
+
DISCLAIMER
|
84
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
85
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
86
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
87
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
88
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
89
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
90
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
91
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
92
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,251 @@
|
|
1
|
+
<Material name="concrete" version="1.0">
|
2
|
+
<MetaData >
|
3
|
+
<Property formalName="Environment Map" name="uEnvironmentTexture" type="Texture" filter="linear" minfilter="linearMipmapLinear" clamp="repeat" usage="environment" default=".\maps\materials\spherical_checker.png"/>
|
4
|
+
<Property formalName="Enable Environment" name="uEnvironmentMappingEnabled" type="Boolean" default="True"/>
|
5
|
+
<Property name="material_ior" type="Float" default="1.500000" description="Index of refraction of the material"/>
|
6
|
+
<Property name="roughness" type="Float" min="0.000000" max="1.000000" default="0.350000" description="Roughness of the material. A value of 0 makes it completely specular, 1 is completely diffuse"/>
|
7
|
+
<Property name="bump_texture" type="Texture" filter="linear" minfilter="linearMipmapLinear" clamp="repeat" usage="bump" default=".\maps\materials\concrete_plain_bump.png"/>
|
8
|
+
<Property name="texture_tiling" type="Float2" default="5 2" description="Scaling of the textures"/>
|
9
|
+
<Property name="diffuse_texture" type="Texture" filter="linear" minfilter="linearMipmapLinear" clamp="repeat" usage="diffuse" default=".\maps\materials\concrete_plain.png"/>
|
10
|
+
<Property name="bump_amount" type="Float" default="6.000000" description="Value determining the bumpiness"/>
|
11
|
+
</MetaData>
|
12
|
+
<Shaders type="GLSL" version="330">
|
13
|
+
<Shader>
|
14
|
+
<Shared> </Shared>
|
15
|
+
<VertexShader>
|
16
|
+
// add structure defines
|
17
|
+
#define UIC_ENABLE_UV0 1
|
18
|
+
#define UIC_ENABLE_WORLD_POSITION 1
|
19
|
+
#define UIC_ENABLE_TEXTAN 1
|
20
|
+
#define UIC_ENABLE_BINORMAL 1
|
21
|
+
|
22
|
+
#include "vertexFragmentBase.glsllib"
|
23
|
+
|
24
|
+
// add temporary declarations
|
25
|
+
void main(void)
|
26
|
+
{
|
27
|
+
|
28
|
+
gl_Position = vertexMain();
|
29
|
+
}
|
30
|
+
</VertexShader>
|
31
|
+
<FragmentShader>
|
32
|
+
|
33
|
+
// add enum defines
|
34
|
+
#define mono_alpha 0
|
35
|
+
#define mono_average 1
|
36
|
+
#define mono_luminance 2
|
37
|
+
#define mono_maximum 3
|
38
|
+
#define wrap_clamp 0
|
39
|
+
#define wrap_repeat 1
|
40
|
+
#define wrap_mirrored_repeat 2
|
41
|
+
#define gamma_default 0
|
42
|
+
#define gamma_linear 1
|
43
|
+
#define gamma_srgb 2
|
44
|
+
#define scatter_reflect 0
|
45
|
+
#define scatter_transmit 1
|
46
|
+
#define scatter_reflect_transmit 2
|
47
|
+
|
48
|
+
#define UIC_ENABLE_UV0 1
|
49
|
+
#define UIC_ENABLE_WORLD_POSITION 1
|
50
|
+
#define UIC_ENABLE_TEXTAN 1
|
51
|
+
#define UIC_ENABLE_BINORMAL 1
|
52
|
+
|
53
|
+
#include "vertexFragmentBase.glsllib"
|
54
|
+
|
55
|
+
// set shader output
|
56
|
+
out vec4 fragColor;
|
57
|
+
|
58
|
+
// add structure defines
|
59
|
+
struct layer_result
|
60
|
+
{
|
61
|
+
vec4 base;
|
62
|
+
vec4 layer;
|
63
|
+
mat3 tanFrame;
|
64
|
+
};
|
65
|
+
|
66
|
+
|
67
|
+
struct texture_coordinate_info
|
68
|
+
{
|
69
|
+
vec3 position;
|
70
|
+
vec3 tangent_u;
|
71
|
+
vec3 tangent_v;
|
72
|
+
};
|
73
|
+
|
74
|
+
|
75
|
+
struct texture_return
|
76
|
+
{
|
77
|
+
vec3 tint;
|
78
|
+
float mono;
|
79
|
+
};
|
80
|
+
|
81
|
+
|
82
|
+
// temporary declarations
|
83
|
+
texture_coordinate_info tmp3;
|
84
|
+
vec3 tmp6;
|
85
|
+
vec3 ftmp0;
|
86
|
+
vec3 ftmp1;
|
87
|
+
layer_result layers[2];
|
88
|
+
|
89
|
+
#include "SSAOCustomMaterial.glsllib"
|
90
|
+
#include "sampleLight.glsllib"
|
91
|
+
#include "sampleProbe.glsllib"
|
92
|
+
#include "sampleArea.glsllib"
|
93
|
+
#include "luminance.glsllib"
|
94
|
+
#include "monoChannel.glsllib"
|
95
|
+
#include "fileBumpTexture.glsllib"
|
96
|
+
#include "transformCoordinate.glsllib"
|
97
|
+
#include "rotationTranslationScale.glsllib"
|
98
|
+
#include "textureCoordinateInfo.glsllib"
|
99
|
+
#include "square.glsllib"
|
100
|
+
#include "calculateRoughness.glsllib"
|
101
|
+
#include "evalEnvironmentMap.glsllib"
|
102
|
+
#include "physGlossyBSDF.glsllib"
|
103
|
+
#include "simpleGlossyBSDF.glsllib"
|
104
|
+
#include "fileTexture.glsllib"
|
105
|
+
#include "weightedLayer.glsllib"
|
106
|
+
#include "diffuseReflectionBSDF.glsllib"
|
107
|
+
#include "fresnelLayer.glsllib"
|
108
|
+
|
109
|
+
bool evalTwoSided()
|
110
|
+
{
|
111
|
+
return( false );
|
112
|
+
}
|
113
|
+
|
114
|
+
vec3 computeFrontMaterialEmissive()
|
115
|
+
{
|
116
|
+
return( vec3( 0, 0, 0 ) );
|
117
|
+
}
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
void computeFrontLayerColor( in vec3 normal, in vec3 lightDir, in vec3 lightDiffuse, in vec3 lightSpecular, in float materialIOR, float aoFactor )
|
122
|
+
{
|
123
|
+
#if UIC_ENABLE_CG_LIGHTING
|
124
|
+
layers[0].layer += kggxGlossyBSDF( layers[0].tanFrame, lightDir, viewDir, lightSpecular, materialIOR, roughness, roughness, scatter_reflect );
|
125
|
+
|
126
|
+
layers[1].base += vec4( 0.0f, 0.0f, 0.0f, 1.0f );
|
127
|
+
layers[1].layer += diffuseReflectionBSDF( tmp6, lightDir, lightDiffuse, 0.000000 );
|
128
|
+
|
129
|
+
#endif
|
130
|
+
}
|
131
|
+
|
132
|
+
void computeFrontAreaColor( in int lightIdx, in vec4 lightDiffuse, in vec4 lightSpecular )
|
133
|
+
{
|
134
|
+
#if UIC_ENABLE_CG_LIGHTING
|
135
|
+
layers[0].layer += lightSpecular * sampleAreaGlossy( layers[0].tanFrame, varWorldPos, lightIdx, viewDir, roughness, roughness );
|
136
|
+
|
137
|
+
layers[1].base += vec4( 0.0f, 0.0f, 0.0f, 1.0f );
|
138
|
+
layers[1].layer += lightDiffuse * sampleAreaDiffuse( layers[1].tanFrame, varWorldPos, lightIdx );
|
139
|
+
|
140
|
+
#endif
|
141
|
+
}
|
142
|
+
|
143
|
+
void computeFrontLayerEnvironment( in vec3 normal, float aoFactor )
|
144
|
+
{
|
145
|
+
#if !UIC_ENABLE_LIGHT_PROBE
|
146
|
+
layers[0].layer += simpleGlossyBSDFEnvironment( layers[0].tanFrame, roughness, roughness, scatter_reflect );
|
147
|
+
|
148
|
+
layers[1].base += vec4( 0.0f, 0.0f, 0.0f, 1.0f );
|
149
|
+
layers[1].layer += diffuseReflectionBSDFEnvironment( tmp6, 0.000000 ) * aoFactor;
|
150
|
+
|
151
|
+
#else
|
152
|
+
layers[0].layer += sampleGlossyAniso( layers[0].tanFrame, viewDir, roughness, roughness );
|
153
|
+
|
154
|
+
layers[1].base += vec4( 0.0f, 0.0f, 0.0f, 1.0f );
|
155
|
+
layers[1].layer += sampleDiffuse( layers[1].tanFrame ) * aoFactor;
|
156
|
+
|
157
|
+
#endif
|
158
|
+
}
|
159
|
+
|
160
|
+
vec3 computeBackMaterialEmissive()
|
161
|
+
{
|
162
|
+
return( vec3(0, 0, 0) );
|
163
|
+
}
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
void computeBackLayerColor( in vec3 normal, in vec3 lightDir, in vec3 lightDiffuse, in vec3 lightSpecular, in float materialIOR, float aoFactor )
|
168
|
+
{
|
169
|
+
#if UIC_ENABLE_CG_LIGHTING
|
170
|
+
layers[0].base += vec4( 0.0, 0.0, 0.0, 1.0 );
|
171
|
+
layers[0].layer += vec4( 0.0, 0.0, 0.0, 1.0 );
|
172
|
+
#endif
|
173
|
+
}
|
174
|
+
|
175
|
+
void computeBackAreaColor( in int lightIdx, in vec4 lightDiffuse, in vec4 lightSpecular )
|
176
|
+
{
|
177
|
+
#if UIC_ENABLE_CG_LIGHTING
|
178
|
+
layers[0].base += vec4( 0.0, 0.0, 0.0, 1.0 );
|
179
|
+
layers[0].layer += vec4( 0.0, 0.0, 0.0, 1.0 );
|
180
|
+
#endif
|
181
|
+
}
|
182
|
+
|
183
|
+
void computeBackLayerEnvironment( in vec3 normal, float aoFactor )
|
184
|
+
{
|
185
|
+
#if !UIC_ENABLE_LIGHT_PROBE
|
186
|
+
layers[0].base += vec4( 0.0, 0.0, 0.0, 1.0 );
|
187
|
+
layers[0].layer += vec4( 0.0, 0.0, 0.0, 1.0 );
|
188
|
+
#else
|
189
|
+
layers[0].base += vec4( 0.0, 0.0, 0.0, 1.0 );
|
190
|
+
layers[0].layer += vec4( 0.0, 0.0, 0.0, 1.0 );
|
191
|
+
#endif
|
192
|
+
}
|
193
|
+
|
194
|
+
float computeIOR()
|
195
|
+
{
|
196
|
+
return( false ? 1.0f : luminance( vec3( 1, 1, 1 ) ) );
|
197
|
+
}
|
198
|
+
|
199
|
+
float evalCutout()
|
200
|
+
{
|
201
|
+
return( 1.000000 );
|
202
|
+
}
|
203
|
+
|
204
|
+
vec3 computeNormal()
|
205
|
+
{
|
206
|
+
return( normal );
|
207
|
+
}
|
208
|
+
|
209
|
+
void computeTemporaries()
|
210
|
+
{
|
211
|
+
tmp3 = transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), vec3( texture_tiling[0], texture_tiling[1], 1.000000 ) ), textureCoordinateInfo( texCoord0, tangent, binormal ) );
|
212
|
+
tmp6 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal );
|
213
|
+
ftmp0 = fileTexture(bump_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint;
|
214
|
+
ftmp1 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_srgb ).tint;
|
215
|
+
}
|
216
|
+
|
217
|
+
vec4 computeLayerWeights( in float alpha )
|
218
|
+
{
|
219
|
+
vec4 color;
|
220
|
+
color = weightedLayer( 1.000000, vec4( ftmp1, 1.0).rgb, layers[1].layer, layers[1].base, alpha );
|
221
|
+
color = fresnelLayer( tmp6, vec3( material_ior ), 1.000000, vec4( ftmp0, 1.0).rgb, layers[0].layer, color, color.a );
|
222
|
+
return color;
|
223
|
+
}
|
224
|
+
|
225
|
+
|
226
|
+
void main(void)
|
227
|
+
{
|
228
|
+
initializeBaseFragmentVariables();
|
229
|
+
computeTemporaries();
|
230
|
+
normal = normalize( computeNormal() );
|
231
|
+
|
232
|
+
// clear layers
|
233
|
+
layers[0].base = vec4(0.0, 0.0, 0.0, 1.0);
|
234
|
+
layers[0].layer = vec4(0.0, 0.0, 0.0, 1.0);
|
235
|
+
layers[0].tanFrame = orthoNormalize( mat3( tangent, cross(tmp6, tangent), tmp6 ) );
|
236
|
+
layers[1].base = vec4(0.0, 0.0, 0.0, 1.0);
|
237
|
+
layers[1].layer = vec4(0.0, 0.0, 0.0, 1.0);
|
238
|
+
layers[1].tanFrame = orthoNormalize( mat3( tangent, cross(tmp6, tangent), tmp6 ) );
|
239
|
+
|
240
|
+
float alpha = clamp( evalCutout(), 0.0, 1.0 );
|
241
|
+
#include "customMaterialFragBodyAO.glsllib"
|
242
|
+
fragColor = rgba;
|
243
|
+
}
|
244
|
+
</FragmentShader>
|
245
|
+
</Shader>
|
246
|
+
</Shaders>
|
247
|
+
<Passes >
|
248
|
+
<Pass >
|
249
|
+
</Pass>
|
250
|
+
</Passes>
|
251
|
+
</Material>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
This folder should be used to hold any custom materials that you add to your project.
|
2
|
+
|
3
|
+
You can find sample custom materials in the Material Library supplied with Studio (accessible from the bottom of the Project palette). For more information on writing custom materials, see the documentation page "The .material Format" in the "File Formats" section.
|