Assets cleanup
@@ -1,28 +0,0 @@
|
||||
import bpy
|
||||
import arm.assets
|
||||
import arm.make_renderpath
|
||||
import arm.utils
|
||||
|
||||
def on_make_world():
|
||||
wrd = bpy.data.worlds['Arm']
|
||||
wrd.world_defs += '_EnvTex'
|
||||
wrd.world_defs += '_EnvStr'
|
||||
wrd.world_defs += '_CGrainStatic'
|
||||
wrd.world_defs += '_Emission'
|
||||
wrd.world_defs += '_Brdf'
|
||||
wrd.world_defs += '_Irr'
|
||||
wrd.world_defs += '_Rad'
|
||||
|
||||
def on_make_renderpath():
|
||||
wrd = bpy.data.worlds['Arm']
|
||||
arm.assets.add_shader_pass('copy_mrt3_pass')
|
||||
arm.assets.add(arm.utils.get_sdk_path() + '/armory/Assets/noise256.png')
|
||||
arm.assets.add_embedded_data('noise256.png')
|
||||
wrd.arm_envtex_num_mips = 10
|
||||
wrd.arm_envtex_name = 'World.hdr'
|
||||
wrd.arm_envtex_irr_name = 'World'
|
||||
wrd.arm_envtex_strength = 4.0
|
||||
|
||||
def register():
|
||||
arm.make_world.callback = on_make_world
|
||||
arm.make_renderpath.callback = on_make_renderpath
|
||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 313 B After Width: | Height: | Size: 313 B |
@@ -0,0 +1,122 @@
|
||||
// An Analytic Model for Full Spectral Sky-Dome Radiance
|
||||
// Lukas Hosek and Alexander Wilkie
|
||||
// Based on https://github.com/ddiakopoulos/sandbox
|
||||
package arm;
|
||||
|
||||
import kha.math.FastVector3;
|
||||
import iron.data.WorldData;
|
||||
|
||||
class HosekWilkieRadianceData {
|
||||
|
||||
public var A = new FastVector3();
|
||||
public var B = new FastVector3();
|
||||
public var C = new FastVector3();
|
||||
public var D = new FastVector3();
|
||||
public var E = new FastVector3();
|
||||
public var F = new FastVector3();
|
||||
public var G = new FastVector3();
|
||||
public var H = new FastVector3();
|
||||
public var I = new FastVector3();
|
||||
public var Z = new FastVector3();
|
||||
|
||||
function evaluateSpline(spline:Array<Float>, index:Int, stride:Int, value:Float):Float {
|
||||
return
|
||||
1 * Math.pow(1 - value, 5) * spline[index ] +
|
||||
5 * Math.pow(1 - value, 4) * Math.pow(value, 1) * spline[index + 1 * stride] +
|
||||
10 * Math.pow(1 - value, 3) * Math.pow(value, 2) * spline[index + 2 * stride] +
|
||||
10 * Math.pow(1 - value, 2) * Math.pow(value, 3) * spline[index + 3 * stride] +
|
||||
5 * Math.pow(1 - value, 1) * Math.pow(value, 4) * spline[index + 4 * stride] +
|
||||
1 * Math.pow(value, 5) * spline[index + 5 * stride];
|
||||
}
|
||||
|
||||
function clamp(n:Int, lower:Int, upper:Int) {
|
||||
return n <= lower ? lower : n >= upper ? upper : n;
|
||||
}
|
||||
|
||||
function clampF(n:Float, lower:Float, upper:Float) {
|
||||
return n <= lower ? lower : n >= upper ? upper : n;
|
||||
}
|
||||
|
||||
function evaluate(dataset:Array<Float>, index:Int, stride:Int, turbidity:Float, albedo:Float, sunTheta:Float):Float {
|
||||
// Splines are functions of elevation^1/3
|
||||
var elevationK:Float = Math.pow(Math.max(0.0, 1.0 - sunTheta / (Math.PI / 2.0)), 1.0 / 3.0);
|
||||
|
||||
// Table has values for turbidity 1..10
|
||||
var turbidity0:Int = clamp(Std.int(turbidity), 1, 10);
|
||||
var turbidity1:Int = Std.int(Math.min(turbidity0 + 1, 10));
|
||||
var turbidityK:Float = clampF(turbidity - turbidity0, 0.0, 1.0);
|
||||
|
||||
var datasetA0Index = index;
|
||||
var datasetA1Index = index + stride * 6 * 10;
|
||||
|
||||
var a0t0:Float = evaluateSpline(dataset, datasetA0Index + stride * 6 * (turbidity0 - 1), stride, elevationK);
|
||||
var a1t0:Float = evaluateSpline(dataset, datasetA1Index + stride * 6 * (turbidity0 - 1), stride, elevationK);
|
||||
var a0t1:Float = evaluateSpline(dataset, datasetA0Index + stride * 6 * (turbidity1 - 1), stride, elevationK);
|
||||
var a1t1:Float = evaluateSpline(dataset, datasetA1Index + stride * 6 * (turbidity1 - 1), stride, elevationK);
|
||||
|
||||
return a0t0 * (1 - albedo) * (1 - turbidityK) + a1t0 * albedo * (1 - turbidityK) + a0t1 * (1 - albedo) * turbidityK + a1t1 * albedo * turbidityK;
|
||||
}
|
||||
|
||||
function hosek_wilkie(cos_theta:Float, gamma:Float, cos_gamma:Float, A:FastVector3, B:FastVector3, C:FastVector3, D:FastVector3, E:FastVector3, F:FastVector3, G:FastVector3, H:FastVector3, I:FastVector3):FastVector3 {
|
||||
var val = (1.0 + cos_gamma * cos_gamma);
|
||||
var chix = val / Math.pow(1.0 + H.x * H.x - 2.0 * cos_gamma * H.x, 1.5);
|
||||
var chiy = val / Math.pow(1.0 + H.y * H.y - 2.0 * cos_gamma * H.y, 1.5);
|
||||
var chiz = val / Math.pow(1.0 + H.z * H.z - 2.0 * cos_gamma * H.z, 1.5);
|
||||
var chi = new FastVector3(chix, chiy, chiz);
|
||||
|
||||
var vx = (1.0 + A.x * Math.exp(B.x / (cos_theta + 0.01))) * (C.x + D.x * Math.exp(E.x * gamma) + F.x * (cos_gamma * cos_gamma) + G.x * chi.x + I.x * Math.sqrt(Math.max(0.0, cos_theta)));
|
||||
var vy = (1.0 + A.y * Math.exp(B.y / (cos_theta + 0.01))) * (C.y + D.y * Math.exp(E.y * gamma) + F.y * (cos_gamma * cos_gamma) + G.y * chi.y + I.y * Math.sqrt(Math.max(0.0, cos_theta)));
|
||||
var vz = (1.0 + A.z * Math.exp(B.z / (cos_theta + 0.01))) * (C.z + D.z * Math.exp(E.z * gamma) + F.z * (cos_gamma * cos_gamma) + G.z * chi.z + I.z * Math.sqrt(Math.max(0.0, cos_theta)));
|
||||
return new FastVector3(vx, vy, vz);
|
||||
}
|
||||
|
||||
function setVector(v:FastVector3, index:Int, f:Float) {
|
||||
index == 0 ? v.x = f : index == 1 ? v.y = f : v.z = f;
|
||||
}
|
||||
|
||||
public function new() {}
|
||||
|
||||
public function recompute(sunTheta:Float, turbidity:kha.FastFloat, albedo:kha.FastFloat, normalizedSunY:Float) {
|
||||
for (i in 0...3) {
|
||||
setVector(A, i, evaluate(HosekWilkieData.datasetsRGB[i], 0, 9, turbidity, albedo, sunTheta));
|
||||
setVector(B, i, evaluate(HosekWilkieData.datasetsRGB[i], 1, 9, turbidity, albedo, sunTheta));
|
||||
setVector(C, i, evaluate(HosekWilkieData.datasetsRGB[i], 2, 9, turbidity, albedo, sunTheta));
|
||||
setVector(D, i, evaluate(HosekWilkieData.datasetsRGB[i], 3, 9, turbidity, albedo, sunTheta));
|
||||
setVector(E, i, evaluate(HosekWilkieData.datasetsRGB[i], 4, 9, turbidity, albedo, sunTheta));
|
||||
setVector(F, i, evaluate(HosekWilkieData.datasetsRGB[i], 5, 9, turbidity, albedo, sunTheta));
|
||||
setVector(G, i, evaluate(HosekWilkieData.datasetsRGB[i], 6, 9, turbidity, albedo, sunTheta));
|
||||
|
||||
// Swapped in the dataset
|
||||
setVector(H, i, evaluate(HosekWilkieData.datasetsRGB[i], 8, 9, turbidity, albedo, sunTheta));
|
||||
setVector(I, i, evaluate(HosekWilkieData.datasetsRGB[i], 7, 9, turbidity, albedo, sunTheta));
|
||||
|
||||
setVector(Z, i, evaluate(HosekWilkieData.datasetsRGBRad[i], 0, 1, turbidity, albedo, sunTheta));
|
||||
}
|
||||
|
||||
if (normalizedSunY != 0.0) {
|
||||
var S:FastVector3 = hosek_wilkie(Math.cos(sunTheta), 0, 1.0, A, B, C, D, E, F, G, H, I);
|
||||
S.x *= Z.x;
|
||||
S.y *= Z.y;
|
||||
S.z *= Z.z;
|
||||
var dotS = S.dot(new FastVector3(0.2126, 0.7152, 0.0722));
|
||||
Z.x /= dotS;
|
||||
Z.y /= dotS;
|
||||
Z.z /= dotS;
|
||||
Z = Z.mult(normalizedSunY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class HosekWilkie {
|
||||
public static var data:HosekWilkieRadianceData = null;
|
||||
|
||||
public static function recompute(world:WorldData) {
|
||||
if (world == null || world.raw.sun_direction == null) return;
|
||||
if (data == null) data = new HosekWilkieRadianceData();
|
||||
// Clamp Z for night cycle
|
||||
var sunZ = world.raw.sun_direction[2] > 0 ? world.raw.sun_direction[2] : 0;
|
||||
var sunPositionX = Math.acos(sunZ);
|
||||
var normalizedSunY:kha.FastFloat = 1.15;
|
||||
data.recompute(sunPositionX, world.raw.turbidity, world.raw.ground_albedo, normalizedSunY);
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 953 KiB |
@@ -0,0 +1,7 @@
|
||||
#?RADIANCE
|
||||
# Output from cmft.
|
||||
FORMAT=32-bit_rle_rgbe
|
||||
EXPOSURE=1
|
||||
|
||||
-Y 16 +X 32
|
||||
?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤?h祤Cl簚Cl簚Bl箑Bk箑Aj竴Aj竴Aj竴Aj穩Ai穩@i秬?h祤>g磤>f硛>g硛?g磤?g磤?g磤?g磤>g硛>f硛>g磤?h祤@i秬@i穩Aj穩Aj竴Aj竴Aj竴Bk箑Bl箑Cl簚Cl簚Ju膧Ju脌Jt脌It脌It聙Hr羳Gq縺Fp線Eo絸Dn粈Dm粈Dm簚Dm簚Cl箑Bk穩Bk竴Bk竴Bk穩Cl竴Cm簚Dm簚Dm簚Dn粈Eo絸Fp線Fq縺Hr纮It聙It脌It脌Ju脌Ju膧U傁€T佄€T佅€S€蝷S蛝R~藔P|蓘O{莯Nz苺Mx膧Mx膧Lw脌Lv聙Lv聙Ku纮Ku纮Ku纮Ku纮Kv羳Lv聙Lw脌Mx膧Mx膧Ny艀Oz莯P|蓘R~藔S蛝S€蝷T佅€T佄€U傁€j涐€j涐€i氞€`徺€_庁€^屩€e斮€d撠€c撟€b懼€Y喯€X呂€X呁€W勌€`幰€`幰€`幰€`幰€W勌€X呁€X呁€Y單€b懼€c捵€d撠€d斮€^屩€_庁€`徺€i氞€j涐€j涐€tㄦ€tф€s﹀€rュ€p⑩€p⑨€o∵€o犧€n犦€m熭€l澻€k溮€k涄€k溬€k溬€k溬€k溬€k溬€k涃€k涄€k溮€l澺€m炣€n熭€n犧€o∵€p♂€p⑩€rュ€s﹀€tф€tㄦ€|辩€|扮€|扮€{�€y�€x�€x�€w�€v�€v┼€u┻€uㄟ€tм€tм€tм€tл€tл€tл€tм€tм€uㄟ€uㄟ€v┼€v�€w�€w�€x�€y�€{�€{扮€|扮€|辩€偡鍊伔鍊伔鍊伔鍊€典€淬€~斥€}翅€}册€|侧€|编€|编€{编€{斑€{斑€{斑€{斑€{斑€{斑€{编€|编€|编€|侧€|册€}册€~斥€~粹€€点€伔鍊伔鍊伔鍊偡鍊吇醼劵醼劵鄝劵鄝兒鄝偣鄝伖還伕還€高€€高€€高€€高€€愤€忿€忿€掇€掇€忿€忿€€愤€€高€€愤€€愤€€高€伕還伖還偣鄝兒鄝劵鄝劵鄝劵鄝吇醼吔軃吔踿吔踿吔踿劷踿兗軃偧軃偧軃伝軃伝軃伝輤伡輤伡輤€惠€€惠€€惠€€惠€€惠€€惠€伡輤伡輤伝輤伝輤伝輤偧軃偧軃兗軃劷踿吔踿吔踿吔踿吔軃劸讇劸讇劸讇兙讇兙貈偩賭伨趢伨趢伨踿€聚€€聚€€聚€拒€拒€据€据€据€据€据€拒€€拒€€聚€€聚€伨踿伨趢伨趢偩賭偩貈兙讇劸讇劸讇劸讇伩謤伩謤伩謤~孔€}控€}控€抠€~口€~扣€~扣€z垒€z擂€z擂€z肋€|哭€|哭€|哭€|哭€z肋€z擂€z擂€z垒€}寇€~扣€~口€抠€}抠€}控€~孔€伩謤伩謤伩謤z扣€z扣€z扣€y扣€y寇€x枯€x擂€x肋€w类€w类€v泪€v泪€v棱€v棱€u零€u零€u零€u零€v零€v棱€v棱€v泪€w泪€w类€x肋€x擂€x枯€y寇€y扣€z扣€z扣€z扣€v类€v类€v类€v类€u泪€u棱€u棱€t楞€t龄€t龄€s铃€s铃€s铃€s伶€r羚€s羚€s羚€r羚€s伶€s伶€s铃€s铃€t铃€t龄€t楞€u楞€u棱€u泪€v泪€v类€v类€v类€s铃€s铃€s铃€s铃€s伶€s伶€s伶€s伶€r伶€r羚€r羚€r凌€q凌€r凌€r凌€r凌€r凌€r凌€q凌€q凌€r凌€r羚€r羚€r羚€s伶€s伶€s伶€s伶€s铃€s铃€s铃€s铃€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€r羚€
|
||||
@@ -0,0 +1,7 @@
|
||||
#?RADIANCE
|
||||
# Written by stb_image_write.h
|
||||
FORMAT=32-bit_rle_rgbe
|
||||
EXPOSURE= 1.0000000000000
|
||||
|
||||
-Y 2 +X 4
|
||||
^�΀Z‰É€Z‰É€^�΀y»Þ€vºà€vºà€y»Þ€
|
||||
@@ -0,0 +1,7 @@
|
||||
#?RADIANCE
|
||||
# Written by stb_image_write.h
|
||||
FORMAT=32-bit_rle_rgbe
|
||||
EXPOSURE= 1.0000000000000
|
||||
|
||||
-Y 1 +X 2
|
||||
i¢Õ€i¢Õ€
|
||||
@@ -0,0 +1,7 @@
|
||||
#?RADIANCE
|
||||
# Written by stb_image_write.h
|
||||
FORMAT=32-bit_rle_rgbe
|
||||
EXPOSURE= 1.0000000000000
|
||||
|
||||
-Y 1 +X 1
|
||||
i¢Õ€
|
||||
|
After Width: | Height: | Size: 410 KiB |
|
After Width: | Height: | Size: 461 KiB |
|
After Width: | Height: | Size: 61 KiB |
@@ -0,0 +1,99 @@
|
||||
#version 450
|
||||
|
||||
#include "../../compiled/Shaders/compiled.inc"
|
||||
#include "../../compiled/Shaders/std/gbuffer.glsl"
|
||||
#include "../../compiled/Shaders/std/math.glsl"
|
||||
|
||||
uniform sampler2D gbufferD;
|
||||
uniform sampler2D tex;
|
||||
uniform sampler2D sbase;
|
||||
uniform sampler2D sdetail;
|
||||
uniform sampler2D sfoam;
|
||||
#ifdef _Rad
|
||||
uniform sampler2D senvmapRadiance;
|
||||
#endif
|
||||
|
||||
uniform float time;
|
||||
uniform vec3 eye;
|
||||
uniform vec3 eyeLook;
|
||||
uniform vec2 cameraProj;
|
||||
uniform vec3 ld;
|
||||
uniform float envmapStrength;
|
||||
|
||||
in vec2 texCoord;
|
||||
in vec3 viewRay;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
|
||||
float gdepth = textureLod(gbufferD, texCoord, 0.0).r * 2.0 - 1.0;
|
||||
if (gdepth == 1.0) {
|
||||
fragColor = vec4(0.0);
|
||||
return;
|
||||
}
|
||||
|
||||
// Eye below water
|
||||
if (eye.z < waterLevel) {
|
||||
fragColor = vec4(0.0);
|
||||
return;
|
||||
}
|
||||
|
||||
// Displace surface
|
||||
vec3 vray = normalize(viewRay);
|
||||
vec3 p = getPos(eye, eyeLook, vray, gdepth, cameraProj);
|
||||
float speed = time * 2.0 * waterSpeed;
|
||||
p.z += sin(p.x * 10.0 / waterDisplace + speed) * cos(p.y * 10.0 / waterDisplace + speed) / 50.0 * waterDisplace;
|
||||
|
||||
// Above water
|
||||
if (p.z > waterLevel) {
|
||||
fragColor = vec4(0.0);
|
||||
return;
|
||||
}
|
||||
|
||||
// Hit plane to determine uvs
|
||||
vec3 v = normalize(eye - p.xyz);
|
||||
float t = -(dot(eye, vec3(0.0, 0.0, 1.0)) - waterLevel) / dot(v, vec3(0.0, 0.0, 1.0));
|
||||
vec3 hit = eye + t * v;
|
||||
hit.xy *= waterFreq;
|
||||
hit.z += waterLevel;
|
||||
|
||||
// Sample normal maps
|
||||
vec2 tcnor0 = hit.xy / 3.0;
|
||||
vec3 n0 = textureLod(sdetail, tcnor0 + vec2(speed / 60.0, speed / 120.0), 0.0).rgb;
|
||||
|
||||
vec2 tcnor1 = hit.xy / 6.0 + n0.xy / 20.0;
|
||||
vec3 n1 = textureLod(sbase, tcnor1 + vec2(speed / 40.0, speed / 80.0), 0.0).rgb;
|
||||
vec3 n2 = normalize(((n1 + n0) / 2.0) * 2.0 - 1.0);
|
||||
|
||||
float ddepth = textureLod(gbufferD, texCoord + (n2.xy * n2.z) / 40.0, 0.0).r * 2.0 - 1.0;
|
||||
vec3 p2 = getPos(eye, eyeLook, vray, ddepth, cameraProj);
|
||||
vec2 tc = p2.z > waterLevel ? texCoord : texCoord + (n2.xy * n2.z) / 30.0 * waterRefract;
|
||||
|
||||
// Light
|
||||
float fresnel = 1.0 - max(dot(n2, v), 0.0);
|
||||
fresnel = pow(fresnel, 30.0) * 0.45;
|
||||
vec3 r = reflect(-v, n2);
|
||||
#ifdef _Rad
|
||||
vec3 reflected = textureLod(senvmapRadiance, envMapEquirect(r), 0).rgb;
|
||||
#else
|
||||
const vec3 reflected = vec3(0.5);
|
||||
#endif
|
||||
vec3 refracted = textureLod(tex, tc, 0.0).rgb;
|
||||
fragColor.rgb = mix(refracted, reflected, fresnel * waterReflect);
|
||||
fragColor.rgb *= waterColor;
|
||||
fragColor.rgb += clamp(pow(max(dot(r, ld), 0.0), 200.0) * (200.0 + 8.0) / (PI * 8.0), 0.0, 2.0);
|
||||
fragColor.rgb *= 1.0 - (clamp(-(p.z - waterLevel) * waterDensity, 0.0, 0.9));
|
||||
fragColor.a = clamp(abs(p.z - waterLevel) * 5.0, 0.0, 1.0);
|
||||
|
||||
// Foam
|
||||
float fd = abs(p.z - waterLevel);
|
||||
if (fd < 0.1) {
|
||||
// Based on foam by Owen Deery
|
||||
// http://fire-face.com/personal/water
|
||||
vec3 foamMask0 = textureLod(sfoam, tcnor0 * 10, 0.0).rgb;
|
||||
vec3 foamMask1 = textureLod(sfoam, tcnor1 * 11, 0.0).rgb;
|
||||
vec3 foam = vec3(1.0) - foamMask0.rrr - foamMask1.bbb;
|
||||
float fac = 1.0 - (fd * (1.0 / 0.1));
|
||||
fragColor.rgb = mix(fragColor.rgb, clamp(foam, 0.0, 1.0), clamp(fac, 0.0, 1.0));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||