Cleaning up.
This commit is contained in:
parent
0bbd0a59a3
commit
85ea9845f2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Assets/hosek_original/hosek_radiance.hdr
Normal file
BIN
Assets/hosek_original/hosek_radiance.hdr
Normal file
Binary file not shown.
BIN
Assets/hosek_original/hosek_radiance_0.hdr
Normal file
BIN
Assets/hosek_original/hosek_radiance_0.hdr
Normal file
Binary file not shown.
BIN
Assets/hosek_original/hosek_radiance_1.hdr
Normal file
BIN
Assets/hosek_original/hosek_radiance_1.hdr
Normal file
Binary file not shown.
BIN
Assets/hosek_original/hosek_radiance_2.hdr
Normal file
BIN
Assets/hosek_original/hosek_radiance_2.hdr
Normal file
Binary file not shown.
BIN
Assets/hosek_original/hosek_radiance_3.hdr
Normal file
BIN
Assets/hosek_original/hosek_radiance_3.hdr
Normal file
Binary file not shown.
BIN
Assets/hosek_original/hosek_radiance_4.hdr
Normal file
BIN
Assets/hosek_original/hosek_radiance_4.hdr
Normal file
Binary file not shown.
BIN
Assets/hosek_original/hosek_radiance_5.hdr
Normal file
BIN
Assets/hosek_original/hosek_radiance_5.hdr
Normal file
Binary file not shown.
BIN
Assets/hosek_original/hosek_radiance_6.hdr
Normal file
BIN
Assets/hosek_original/hosek_radiance_6.hdr
Normal file
Binary file not shown.
BIN
Assets/hosek_original/hosek_radiance_7.hdr
Normal file
BIN
Assets/hosek_original/hosek_radiance_7.hdr
Normal file
Binary file not shown.
|
@ -103,7 +103,7 @@ class HosekWilkieRadianceData {
|
|||
Z.x /= dotS;
|
||||
Z.y /= dotS;
|
||||
Z.z /= dotS;
|
||||
Z.mult(normalizedSunY);
|
||||
Z = Z.mult(normalizedSunY);
|
||||
}
|
||||
|
||||
// Store in a single float array for shader access
|
||||
|
|
|
@ -6,6 +6,7 @@ import iron.system.Input;
|
|||
import iron.math.Vec4;
|
||||
import iron.math.Quat;
|
||||
|
||||
@:keep
|
||||
class ArcBall extends Trait {
|
||||
|
||||
public function new() {
|
||||
|
|
|
@ -6,6 +6,7 @@ import iron.object.Object;
|
|||
import armory.trait.internal.PhysicsWorld;
|
||||
import armory.trait.internal.CameraController;
|
||||
|
||||
@:keep
|
||||
class FirstPersonController extends CameraController {
|
||||
|
||||
#if (!WITH_PHYSICS)
|
||||
|
|
|
@ -11,6 +11,7 @@ import iron.object.CameraObject;
|
|||
import armory.trait.internal.RigidBody;
|
||||
import armory.system.Keymap;
|
||||
|
||||
@:keep
|
||||
class GunController extends Trait {
|
||||
|
||||
#if (!WITH_PHYSICS)
|
||||
|
|
|
@ -3,6 +3,7 @@ package armory.trait;
|
|||
import iron.Trait;
|
||||
import iron.object.MeshObject;
|
||||
|
||||
@:keep
|
||||
class MirrorTexture extends Trait {
|
||||
|
||||
var cameraName:String;
|
||||
|
|
|
@ -2,6 +2,7 @@ package armory.trait;
|
|||
|
||||
import iron.Trait;
|
||||
|
||||
@:keep
|
||||
class NavAgent extends Trait {
|
||||
|
||||
// nav mesh
|
||||
|
|
|
@ -2,6 +2,7 @@ package armory.trait;
|
|||
|
||||
import iron.Trait;
|
||||
|
||||
@:keep
|
||||
class NavCrowd extends Trait {
|
||||
|
||||
public function new() {
|
||||
|
|
|
@ -2,6 +2,7 @@ package armory.trait;
|
|||
|
||||
import iron.Trait;
|
||||
|
||||
@:keep
|
||||
class NavMesh extends Trait {
|
||||
|
||||
public function new() {
|
||||
|
|
|
@ -8,6 +8,7 @@ import armory.trait.internal.PhysicsWorld;
|
|||
import haxebullet.Bullet;
|
||||
#end
|
||||
|
||||
@:keep
|
||||
class PhysicsDrag extends Trait {
|
||||
|
||||
#if (!WITH_PHYSICS)
|
||||
|
|
|
@ -2,6 +2,7 @@ package armory.trait;
|
|||
|
||||
import iron.Trait;
|
||||
|
||||
@:keep
|
||||
class SceneInstance extends Trait {
|
||||
|
||||
function safeFilename(s:String) {
|
||||
|
|
|
@ -3,6 +3,7 @@ package armory.trait;
|
|||
import iron.math.Vec4;
|
||||
import armory.trait.internal.CameraController;
|
||||
|
||||
@:keep
|
||||
class SidescrollerController extends CameraController {
|
||||
|
||||
#if (!WITH_PHYSICS)
|
||||
|
|
|
@ -5,6 +5,7 @@ import iron.system.Input;
|
|||
import armory.trait.internal.PhysicsWorld;
|
||||
import armory.trait.internal.CameraController;
|
||||
|
||||
@:keep
|
||||
class ThirdPersonController extends CameraController {
|
||||
|
||||
#if (!WITH_PHYSICS)
|
||||
|
|
|
@ -11,6 +11,7 @@ import armory.system.Keymap;
|
|||
import haxebullet.Bullet;
|
||||
#end
|
||||
|
||||
@:keep
|
||||
class VehicleBody extends Trait {
|
||||
|
||||
#if (!WITH_PHYSICS)
|
||||
|
|
|
@ -9,6 +9,7 @@ import iron.math.Vec4;
|
|||
import iron.math.Quat;
|
||||
import armory.system.Keymap;
|
||||
|
||||
@:keep
|
||||
class WalkNavigation extends Trait {
|
||||
|
||||
static inline var speed = 5.0;
|
||||
|
@ -52,11 +53,11 @@ class WalkNavigation extends Trait {
|
|||
}
|
||||
if (strafeUp) {
|
||||
var dir = new Vec4(0, 0, 1);
|
||||
camera.move(dir, -d);
|
||||
camera.move(dir, d);
|
||||
}
|
||||
else if (strafeDown) {
|
||||
var dir = new Vec4(0, 0, 1);
|
||||
camera.move(dir, d);
|
||||
camera.move(dir, -d);
|
||||
}
|
||||
|
||||
if (Input.touch) {
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
package armory.trait.internal;
|
||||
|
||||
import iron.Trait;
|
||||
|
||||
class Animation extends Trait {
|
||||
|
||||
var startTrack:String;
|
||||
var names:Array<String>;
|
||||
var starts:Array<Int>;
|
||||
var ends:Array<Int>;
|
||||
var speeds:Array<Float>;
|
||||
var loops:Array<Bool>;
|
||||
var reflects:Array<Bool>;
|
||||
static var maxBones:Int;
|
||||
|
||||
public function new(startTrack:String, names:Array<String>, starts:Array<Int>, ends:Array<Int>, speeds:Array<Float>, loops:Array<Bool>, reflects:Array<Bool>, _maxBones:Int) {
|
||||
super();
|
||||
|
||||
this.startTrack = startTrack;
|
||||
this.names = names;
|
||||
this.starts = starts;
|
||||
this.ends = ends;
|
||||
this.speeds = speeds;
|
||||
this.loops = loops;
|
||||
this.reflects = reflects;
|
||||
maxBones = _maxBones;
|
||||
|
||||
notifyOnAdd(add);
|
||||
notifyOnUpdate(update);
|
||||
}
|
||||
|
||||
function add() {
|
||||
object.setupAnimation(startTrack, names, starts, ends, speeds, loops, reflects, maxBones);
|
||||
}
|
||||
|
||||
function update() {
|
||||
object.setAnimationParams(iron.system.Time.delta);
|
||||
}
|
||||
|
||||
public function play(trackName:String, onTrackComplete:Void->Void = null) {
|
||||
object.animation.player.play(trackName, onTrackComplete);
|
||||
}
|
||||
|
||||
public function pause() {
|
||||
object.animation.player.pause();
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@ import iron.object.Transform;
|
|||
import iron.object.CameraObject;
|
||||
import armory.system.Keymap;
|
||||
|
||||
@:keep
|
||||
class CameraController extends Trait {
|
||||
|
||||
#if (!WITH_PHYSICS)
|
||||
|
|
|
@ -9,6 +9,7 @@ import zui.Zui;
|
|||
import zui.Id;
|
||||
#end
|
||||
|
||||
@:keep
|
||||
class Console extends Trait {
|
||||
|
||||
#if (!WITH_PROFILE)
|
||||
|
|
|
@ -6,6 +6,7 @@ import iron.object.Transform;
|
|||
import iron.system.Input;
|
||||
import iron.math.RayCaster;
|
||||
|
||||
@:keep
|
||||
class EditorSpace extends Trait {
|
||||
|
||||
var gizmo:Object;
|
||||
|
|
|
@ -2,6 +2,7 @@ package armory.trait.internal;
|
|||
|
||||
import iron.Trait;
|
||||
|
||||
@:keep
|
||||
class JSScript extends Trait {
|
||||
|
||||
static var api:JSScriptAPI = null;
|
||||
|
|
|
@ -8,6 +8,7 @@ package armory.trait.internal;
|
|||
// #include <duktape.h>
|
||||
// ')
|
||||
|
||||
@:keep
|
||||
class JSScriptAPI {
|
||||
/*
|
||||
static var ctx:haxeduktape.DukContext;
|
||||
|
|
|
@ -5,6 +5,7 @@ import kha.Video;
|
|||
import iron.Trait;
|
||||
import iron.object.MeshObject;
|
||||
|
||||
@:keep
|
||||
class MovieTexture extends Trait {
|
||||
|
||||
var video:Video;
|
||||
|
|
|
@ -2,6 +2,7 @@ package armory.trait.internal;
|
|||
|
||||
import iron.Trait;
|
||||
|
||||
@:keep
|
||||
class NodeExecutor extends Trait {
|
||||
|
||||
var baseNode:armory.logicnode.Node;
|
||||
|
|
|
@ -9,6 +9,7 @@ import iron.data.Data;
|
|||
import iron.data.MaterialData;
|
||||
import iron.data.MaterialData.MaterialContext;
|
||||
|
||||
@:keep
|
||||
class PathTracer extends Trait {
|
||||
|
||||
var context:MaterialContext;
|
||||
|
|
|
@ -17,6 +17,7 @@ class ContactPair {
|
|||
}
|
||||
}
|
||||
|
||||
@:keep
|
||||
class PhysicsWorld extends Trait {
|
||||
|
||||
#if (!WITH_PHYSICS)
|
||||
|
|
|
@ -9,6 +9,7 @@ import iron.math.Vec4;
|
|||
import iron.object.Transform;
|
||||
import iron.object.MeshObject;
|
||||
|
||||
@:keep
|
||||
class RigidBody extends Trait {
|
||||
|
||||
#if (!WITH_PHYSICS)
|
||||
|
|
Binary file not shown.
|
@ -2596,6 +2596,43 @@ class ArmoryExporter(bpy.types.Operator, ExportHelper):
|
|||
break
|
||||
|
||||
def cb_export_object(self, bobject, o, type):
|
||||
# Animation setup
|
||||
if self.is_bone_animation_enabled(bobject) or self.is_object_animation_enabled(bobject):
|
||||
x = {}
|
||||
if len(bobject.my_cliptraitlist) > 0:
|
||||
# Edit clips enabled
|
||||
x['names'] = []
|
||||
x['starts'] = []
|
||||
x['ends'] = []
|
||||
x['speeds'] = []
|
||||
x['loops'] = []
|
||||
x['reflects'] = []
|
||||
for at in bobject.my_cliptraitlist:
|
||||
if at.enabled_prop:
|
||||
x['names'].append(at.name)
|
||||
x['starts'].append(at.start_prop)
|
||||
x['ends'].append(at.end_prop)
|
||||
x['speeds'].append(at.speed_prop)
|
||||
x['loops'].append(at.loop_prop)
|
||||
x['reflects'].append(at.reflect_prop)
|
||||
x['start_track'] = bobject.start_track_name_prop
|
||||
x['max_bones'] = bpy.data.worlds['Arm'].generate_gpu_skin_max_bones
|
||||
else:
|
||||
# Export default clip, taking full action
|
||||
if self.is_bone_animation_enabled(bobject):
|
||||
begin_frame, end_frame = self.get_action_framerange(bobject.parent.animation_data.action)
|
||||
else:
|
||||
begin_frame, end_frame = self.get_action_framerange(bobject.animation_data.action)
|
||||
x['start_track'] = 'default'
|
||||
x['names'] = ['default']
|
||||
x['starts'] = [begin_frame]
|
||||
x['ends'] = [end_frame]
|
||||
x['speeds'] = [1.0]
|
||||
x['loops'] = [True]
|
||||
x['reflects'] = [False]
|
||||
x['max_bones'] = bpy.data.worlds['Arm'].generate_gpu_skin_max_bones
|
||||
o['animation_setup'] = x
|
||||
|
||||
# Export traits
|
||||
o['traits'] = []
|
||||
for t in bobject.my_traitlist:
|
||||
|
@ -2606,17 +2643,18 @@ class ArmoryExporter(bpy.types.Operator, ExportHelper):
|
|||
x['type'] = 'Script'
|
||||
x['class_name'] = bpy.data.worlds['Arm'].ArmProjectPackage + '.node.' + utils.safe_filename(t.nodes_name_prop)
|
||||
elif t.type_prop == 'JS Script' or t.type_prop == 'Python Script':
|
||||
basename = t.jsscript_prop.split('.')[0]
|
||||
x['type'] = 'Script'
|
||||
x['class_name'] = 'armory.trait.internal.JSScript'
|
||||
x['parameters'] = [utils.safe_filename(t.jsscript_prop)]
|
||||
x['parameters'] = [utils.safe_filename(basename)]
|
||||
scriptspath = utils.get_fp() + '/build/compiled/scripts/'
|
||||
if not os.path.exists(scriptspath):
|
||||
os.makedirs(scriptspath)
|
||||
# Compile to JS
|
||||
if t.type_prop == 'Python Script':
|
||||
# Write py to file
|
||||
pyname = t.jsscript_prop + '.py'
|
||||
targetpath = scriptspath + pyname
|
||||
basename_ext = basename + '.py'
|
||||
targetpath = scriptspath + basename_ext
|
||||
with open(targetpath, 'w') as f:
|
||||
f.write(bpy.data.texts[t.jsscript_prop].as_string())
|
||||
sdk_path = utils.get_sdk_path()
|
||||
|
@ -2631,10 +2669,10 @@ class ArmoryExporter(bpy.types.Operator, ExportHelper):
|
|||
cwd = os.getcwd()
|
||||
os.chdir(scriptspath)
|
||||
# Disable minification for now, too slow
|
||||
transproc = subprocess.Popen([python_path + ' ' + sdk_path + '/lib/transcrypt/__main__.py' + ' ' + pyname + ' --nomin'], shell=True)
|
||||
transproc = subprocess.Popen([python_path + ' ' + sdk_path + '/lib/transcrypt/__main__.py' + ' ' + basename_ext + ' --nomin'], shell=True)
|
||||
transproc.wait()
|
||||
if transproc.poll() != 0:
|
||||
make.armory_log('Compiling ' + pyname + ' failed, check console')
|
||||
make.armory_log('Compiling ' + t.jsscript_prop + ' failed, check console')
|
||||
os.chdir(cwd)
|
||||
# Compiled file
|
||||
assets.add('build/compiled/scripts/__javascript__/' + t.jsscript_prop + '.js')
|
||||
|
@ -2660,37 +2698,6 @@ class ArmoryExporter(bpy.types.Operator, ExportHelper):
|
|||
x['parameters'].append(ast.literal_eval(pt.name))
|
||||
o['traits'].append(x)
|
||||
|
||||
# Animation trait
|
||||
if self.is_bone_animation_enabled(bobject) or self.is_object_animation_enabled(bobject):
|
||||
x = {}
|
||||
x['type'] = 'Script'
|
||||
x['class_name'] = 'armory.trait.internal.Animation'
|
||||
if len(bobject.my_cliptraitlist) > 0:
|
||||
# Edit clips enabled
|
||||
names = []
|
||||
starts = []
|
||||
ends = []
|
||||
speeds = []
|
||||
loops = []
|
||||
reflects = []
|
||||
for at in bobject.my_cliptraitlist:
|
||||
if at.enabled_prop:
|
||||
names.append(at.name)
|
||||
starts.append(at.start_prop)
|
||||
ends.append(at.end_prop)
|
||||
speeds.append(at.speed_prop)
|
||||
loops.append(at.loop_prop)
|
||||
reflects.append(at.reflect_prop)
|
||||
x['parameters'] = [bobject.start_track_name_prop, names, starts, ends, speeds, loops, reflects, bpy.data.worlds['Arm'].generate_gpu_skin_max_bones]
|
||||
else:
|
||||
# Export default clip, taking full action
|
||||
if self.is_bone_animation_enabled(bobject):
|
||||
begin_frame, end_frame = self.get_action_framerange(bobject.parent.animation_data.action)
|
||||
else:
|
||||
begin_frame, end_frame = self.get_action_framerange(bobject.animation_data.action)
|
||||
x['parameters'] = ['default', ['default'], [begin_frame], [end_frame], [1.0], [True], [False], bpy.data.worlds['Arm'].generate_gpu_skin_max_bones]
|
||||
o['traits'].append(x)
|
||||
|
||||
# Rigid body trait
|
||||
if bobject.rigid_body != None:
|
||||
ArmoryExporter.export_physics = True
|
||||
|
|
|
@ -200,15 +200,31 @@ def parse_shader(sres, c, con, defs, lines, parse_attributes):
|
|||
for l in c['links']:
|
||||
if l['name'] == cid:
|
||||
valid_link = True
|
||||
|
||||
if 'ifdef' in l:
|
||||
valid_link = False
|
||||
def_found = False
|
||||
for d in defs:
|
||||
for link_def in l['ifdef']:
|
||||
if d == link_def:
|
||||
valid_link = True
|
||||
def_found = True
|
||||
break
|
||||
if valid_link:
|
||||
if def_found:
|
||||
break
|
||||
if not def_found:
|
||||
valid_link = False
|
||||
|
||||
if 'ifndef' in l:
|
||||
def_found = False
|
||||
for d in defs:
|
||||
for link_def in l['ifdef']:
|
||||
if d == link_def:
|
||||
def_found = True
|
||||
break
|
||||
if def_found:
|
||||
break
|
||||
if def_found:
|
||||
valid_link = False
|
||||
|
||||
if valid_link:
|
||||
tu['link'] = l['link']
|
||||
break
|
||||
|
@ -229,15 +245,31 @@ def parse_shader(sres, c, con, defs, lines, parse_attributes):
|
|||
for l in c['links']:
|
||||
if l['name'] == cid:
|
||||
valid_link = True
|
||||
|
||||
if 'ifdef' in l:
|
||||
valid_link = False
|
||||
def_found = False
|
||||
for d in defs:
|
||||
for lifdef in l['ifdef']:
|
||||
if d == lifdef:
|
||||
valid_link = True
|
||||
for link_def in l['ifdef']:
|
||||
if d == link_def:
|
||||
def_found = True
|
||||
break
|
||||
if valid_link:
|
||||
if def_found:
|
||||
break
|
||||
if not def_found:
|
||||
valid_link = False
|
||||
|
||||
if 'ifndef' in l:
|
||||
def_found = False
|
||||
for d in defs:
|
||||
for link_def in l['ifdef']:
|
||||
if d == link_def:
|
||||
def_found = True
|
||||
break
|
||||
if def_found:
|
||||
break
|
||||
if def_found:
|
||||
valid_link = False
|
||||
|
||||
if valid_link:
|
||||
const['link'] = l['link']
|
||||
break
|
||||
|
|
|
@ -19,6 +19,7 @@ import lib.make_datas
|
|||
import lib.make_variants
|
||||
import utils
|
||||
import assets
|
||||
import props
|
||||
# Server
|
||||
import http.server
|
||||
import socketserver
|
||||
|
@ -84,7 +85,7 @@ def def_strings_to_array(strdefs):
|
|||
defs = ['_' + d for d in defs] # Restore _
|
||||
return defs
|
||||
|
||||
def export_data(fp, sdk_path, is_play=False, is_publish=False):
|
||||
def export_data(fp, sdk_path, is_play=False, is_publish=False, in_viewport=False):
|
||||
raw_path = sdk_path + 'armory/raw/'
|
||||
assets_path = sdk_path + 'armory/Assets/'
|
||||
export_physics = bpy.data.worlds['Arm'].ArmPhysics != 'Disabled'
|
||||
|
@ -154,7 +155,7 @@ def export_data(fp, sdk_path, is_play=False, is_publish=False):
|
|||
write_data.write_khafilejs(is_play, export_physics, dce_full=is_publish)
|
||||
|
||||
# Write Main.hx
|
||||
write_data.write_main(is_play, play_project.in_viewport)
|
||||
write_data.write_main(is_play, in_viewport)
|
||||
|
||||
# Copy ammo.js if necessary
|
||||
#if target_name == 'html5':
|
||||
|
@ -193,10 +194,11 @@ def get_kha_target(target_name): # TODO: remove
|
|||
def compile_project(target_name=None, is_publish=False, watch=False):
|
||||
sdk_path = utils.get_sdk_path()
|
||||
ffmpeg_path = utils.get_ffmpeg_path()
|
||||
wrd = bpy.data.worlds['Arm']
|
||||
|
||||
# Set build command
|
||||
if target_name == None:
|
||||
target_name = bpy.data.worlds['Arm'].ArmProjectTarget
|
||||
target_name = wrd.ArmProjectTarget
|
||||
|
||||
if utils.get_os() == 'win':
|
||||
node_path = sdk_path + '/nodejs/node.exe'
|
||||
|
@ -219,6 +221,12 @@ def compile_project(target_name=None, is_publish=False, watch=False):
|
|||
cmd.append('-g')
|
||||
cmd.append('opengl2')
|
||||
|
||||
# User defined commands
|
||||
cmd_text = wrd.ArmCommandLine
|
||||
if cmd_text != '':
|
||||
for s in bpy.data.texts[cmd_text].as_string().split(' '):
|
||||
cmd.append(s)
|
||||
|
||||
# armory_log("Building, see console...")
|
||||
|
||||
if make.play_project.chromium_running:
|
||||
|
@ -248,7 +256,7 @@ def patch_project():
|
|||
os.chdir(fp)
|
||||
export_data(fp, sdk_path, is_play=True)
|
||||
|
||||
def build_project(is_play=False, is_publish=False):
|
||||
def build_project(is_play=False, is_publish=False, in_viewport=False):
|
||||
# Clear flag
|
||||
play_project.in_viewport = False
|
||||
|
||||
|
@ -314,7 +322,7 @@ def build_project(is_play=False, is_publish=False):
|
|||
# Save internal assets
|
||||
|
||||
# Export data
|
||||
export_data(fp, sdk_path, is_play=is_play, is_publish=is_publish)
|
||||
export_data(fp, sdk_path, is_play=is_play, is_publish=is_publish, in_viewport=in_viewport)
|
||||
|
||||
if play_project.playproc == None:
|
||||
armory_progress(50)
|
||||
|
@ -357,7 +365,7 @@ def watch_compile(mode):
|
|||
|
||||
def watch_patch():
|
||||
play_project.compileproc.wait()
|
||||
result = play_project.compileproc.poll()
|
||||
# result = play_project.compileproc.poll()
|
||||
play_project.compileproc = None
|
||||
play_project.compileproc_finished = True
|
||||
|
||||
|
@ -366,7 +374,7 @@ def play_project(self, in_viewport):
|
|||
play_project.play_area = bpy.context.area
|
||||
|
||||
# Build data
|
||||
build_project(is_play=True)
|
||||
build_project(is_play=True, in_viewport=in_viewport)
|
||||
play_project.in_viewport = in_viewport
|
||||
|
||||
wrd = bpy.data.worlds['Arm']
|
||||
|
@ -516,6 +524,7 @@ def clean_project():
|
|||
|
||||
def publish_project():
|
||||
# Force minimize data
|
||||
props.invalidate_compiled_data.enabled = False
|
||||
minimize = bpy.data.worlds['Arm'].ArmMinimize
|
||||
bpy.data.worlds['Arm'].ArmMinimize = True
|
||||
clean_project()
|
||||
|
@ -523,6 +532,7 @@ def publish_project():
|
|||
play_project.compileproc = compile_project(target_name=bpy.data.worlds['Arm'].ArmPublishTarget, is_publish=True)
|
||||
threading.Timer(0.1, watch_compile, ['publish']).start()
|
||||
bpy.data.worlds['Arm'].ArmMinimize = minimize
|
||||
props.invalidate_compiled_data.enabled = True
|
||||
|
||||
# Registration
|
||||
def register():
|
||||
|
|
|
@ -20,20 +20,21 @@ def reload_blend_data():
|
|||
def load_library():
|
||||
sdk_path = utils.get_sdk_path()
|
||||
data_path = sdk_path + '/armory/blender/data/data.blend'
|
||||
data_names = ['forward_path', 'forward_path_low', 'deferred_path', 'deferred_path_low', 'deferred_path_high', 'hybrid_path', 'vr_path', 'pathtrace_path', 'Armory PBR']
|
||||
|
||||
# Remove old
|
||||
for name in data_names:
|
||||
if name in bpy.data.node_groups and name != 'Armory PBR':
|
||||
bpy.data.node_groups.remove(bpy.data.node_groups[name], do_unlink=True)
|
||||
|
||||
# Import
|
||||
data_refs = data_names.copy()
|
||||
with bpy.data.libraries.load(data_path, link=False) as (data_from, data_to):
|
||||
data_to.node_groups = ['forward_path', 'forward_path_low', 'deferred_path', 'deferred_path_low', 'deferred_path_high', 'hybrid_path', 'vr_path', 'pathtrace_path', 'Armory PBR']
|
||||
|
||||
# TODO: cannot use for loop
|
||||
bpy.data.node_groups['forward_path'].use_fake_user = True
|
||||
bpy.data.node_groups['forward_path_low'].use_fake_user = True
|
||||
bpy.data.node_groups['deferred_path'].use_fake_user = True
|
||||
bpy.data.node_groups['deferred_path_low'].use_fake_user = True
|
||||
bpy.data.node_groups['deferred_path_high'].use_fake_user = True
|
||||
bpy.data.node_groups['hybrid_path'].use_fake_user = True
|
||||
bpy.data.node_groups['vr_path'].use_fake_user = True
|
||||
bpy.data.node_groups['pathtrace_path'].use_fake_user = True
|
||||
bpy.data.node_groups['Armory PBR'].use_fake_user = True
|
||||
data_to.node_groups = data_refs
|
||||
|
||||
for ref in data_refs:
|
||||
ref.use_fake_user = True
|
||||
# bpy.data.node_groups[name].use_fake_user = True
|
||||
|
||||
def buildNodeTrees(assets_path):
|
||||
s = bpy.data.filepath.split(os.path.sep)
|
||||
|
|
|
@ -140,6 +140,8 @@ def parse_surface(world, node, context):
|
|||
def parse_color(world, node, context, envmap_strength_const):
|
||||
# Env map included
|
||||
if node.type == 'TEX_ENVIRONMENT':
|
||||
envmap_strength_const['float'] *= 2.0 # Match to cycles
|
||||
|
||||
texture = {}
|
||||
context['bind_textures'].append(texture)
|
||||
texture['name'] = 'envmap'
|
||||
|
@ -187,6 +189,8 @@ def parse_color(world, node, context, envmap_strength_const):
|
|||
|
||||
# Append sky define
|
||||
elif node.type == 'TEX_SKY':
|
||||
envmap_strength_const['float'] *= 0.25 # Match to Cycles
|
||||
|
||||
bpy.data.worlds['Arm'].world_defs += '_EnvSky'
|
||||
# Append sky properties to material
|
||||
const = {}
|
||||
|
@ -209,12 +213,10 @@ def parse_color(world, node, context, envmap_strength_const):
|
|||
bpy.data.worlds['Arm'].world_defs += '_Rad'
|
||||
|
||||
sdk_path = utils.get_sdk_path()
|
||||
# Use fake maps for now
|
||||
assets.add(sdk_path + 'armory/Assets/hosek/hosek_radiance.hdr')
|
||||
for i in range(0, 8):
|
||||
assets.add(sdk_path + 'armory/Assets/hosek/hosek_radiance_' + str(i) + '.hdr')
|
||||
|
||||
world.world_envtex_name = 'hosek'
|
||||
world.world_envtex_num_mips = 8
|
||||
|
||||
# Adjust strength to match Cycles
|
||||
envmap_strength_const['float'] *= 0.25
|
||||
|
|
|
@ -35,7 +35,7 @@ precision mediump float;
|
|||
#endif
|
||||
in vec3 initialRay;
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
uniform vec3 eye;
|
||||
//uniform float textureWeight;
|
||||
uniform float timeSinceStart;
|
||||
|
@ -321,8 +321,8 @@ void main() {
|
|||
"""
|
||||
//}
|
||||
|
||||
outColor = vec4(vec3(col / samples), 1.0);
|
||||
outColor.rgb = pow(outColor.rgb * 0.7, vec3(1.0 / 2.2));
|
||||
fragColor = vec4(vec3(col / samples), 1.0);
|
||||
fragColor.rgb = pow(fragColor.rgb * 0.7, vec3(1.0 / 2.2));
|
||||
}
|
||||
"""
|
||||
|
||||
|
|
|
@ -148,18 +148,22 @@ def on_load_pre(context):
|
|||
|
||||
def invalidate_shader_cache(self, context):
|
||||
# compiled.glsl changed, recompile all shaders next time
|
||||
if invalidate_shader_cache.enabled:
|
||||
fp = utils.get_fp()
|
||||
if os.path.isdir(fp + '/build/compiled/ShaderDatas'):
|
||||
shutil.rmtree(fp + '/build/compiled/ShaderDatas')
|
||||
if invalidate_shader_cache.enabled == False:
|
||||
return
|
||||
fp = utils.get_fp()
|
||||
if os.path.isdir(fp + '/build/compiled/ShaderDatas'):
|
||||
shutil.rmtree(fp + '/build/compiled/ShaderDatas')
|
||||
invalidate_shader_cache.enabled = True # Disable invalidating during build process
|
||||
|
||||
def invalidate_compiled_data(self, context):
|
||||
if invalidate_compiled_data.enabled == False:
|
||||
return
|
||||
fp = utils.get_fp()
|
||||
if os.path.isdir(fp + '/build/compiled/Assets'):
|
||||
shutil.rmtree(fp + '/build/compiled/Assets')
|
||||
if os.path.isdir(fp + '/build/compiled/ShaderDatas'):
|
||||
shutil.rmtree(fp + '/build/compiled/ShaderDatas')
|
||||
invalidate_compiled_data.enabled = True
|
||||
|
||||
def invalidate_mesh_data(self, context):
|
||||
fp = utils.get_fp()
|
||||
|
@ -198,6 +202,7 @@ def initProperties():
|
|||
('Recast', 'Recast', 'Recast')],
|
||||
name = "Navigation", default='Disabled')
|
||||
bpy.types.World.ArmKhafile = StringProperty(name = "Khafile", description="Source appended to khafile.js")
|
||||
bpy.types.World.ArmCommandLine = StringProperty(name = "Command Line", description="Commands appended to khamake")
|
||||
bpy.types.World.ArmMinimize = BoolProperty(name="Minimize Data", description="Export scene data in binary", default=True, update=invalidate_compiled_data)
|
||||
bpy.types.World.ArmOptimizeMesh = BoolProperty(name="Optimize Meshes", description="Export more efficient geometry indices, can prolong build times", default=False, update=invalidate_mesh_data)
|
||||
bpy.types.World.ArmSampledAnimation = BoolProperty(name="Sampled Animation", description="Export object animation as raw matrices", default=False, update=invalidate_compiled_data)
|
||||
|
@ -855,6 +860,7 @@ class ArmoryProjectPanel(bpy.types.Panel):
|
|||
layout.prop(wrd, 'ArmProjectName')
|
||||
layout.prop(wrd, 'ArmProjectPackage')
|
||||
layout.prop_search(wrd, 'ArmKhafile', bpy.data, 'texts', 'Khafile')
|
||||
layout.prop_search(wrd, 'ArmCommandLine', bpy.data, 'texts', 'Command Line')
|
||||
layout.operator('arm.publish')
|
||||
layout.prop(wrd, 'ArmPublishTarget')
|
||||
|
||||
|
|
|
@ -15,11 +15,12 @@ def write_khafilejs(is_play, export_physics, dce_full=False):
|
|||
shader_references = sorted(list(set(assets.shaders)))
|
||||
shader_data_references = sorted(list(set(assets.shader_datas)))
|
||||
asset_references = sorted(list(set(assets.assets)))
|
||||
wrd = bpy.data.worlds['Arm']
|
||||
|
||||
with open('khafile.js', 'w') as f:
|
||||
f.write(
|
||||
"""// Auto-generated
|
||||
let project = new Project('""" + bpy.data.worlds['Arm'].ArmProjectName + """');
|
||||
let project = new Project('""" + wrd.ArmProjectName + """');
|
||||
|
||||
project.addSources('Sources');
|
||||
""")
|
||||
|
@ -35,7 +36,7 @@ project.addSources('Sources');
|
|||
f.write("project.addParameter('-dce full');")
|
||||
|
||||
# Electron live patching
|
||||
# if is_play and bpy.data.worlds['Arm'].ArmPlayLivePatch == True and bpy.data.worlds['Arm'].ArmPlayRuntime == 'Electron':
|
||||
# if is_play and wrd.ArmPlayLivePatch == True and wrd.ArmPlayRuntime == 'Electron':
|
||||
# f.write("project.addDefine('WITH_PATCH_ELECTRON');\n")
|
||||
|
||||
# Native scripting
|
||||
|
@ -52,7 +53,7 @@ project.addSources('Sources');
|
|||
ref = ref.replace('\\', '/')
|
||||
f.write("project.addAssets('" + ref + "');\n")
|
||||
|
||||
if bpy.data.worlds['Arm'].ArmPlayConsole:
|
||||
if wrd.ArmPlayConsole:
|
||||
f.write("project.addDefine('WITH_PROFILE');\n")
|
||||
f.write(add_armory_library(sdk_path, 'lib/zui'))
|
||||
font_path = sdk_path + '/armory/Assets/droid_sans.ttf'
|
||||
|
@ -63,19 +64,19 @@ project.addSources('Sources');
|
|||
# f.write(add_armory_library(sdk_path, 'lib/haxeui/haxeui-kha'))
|
||||
# f.write(add_armory_library(sdk_path, 'lib/haxeui/hscript'))
|
||||
|
||||
if bpy.data.worlds['Arm'].ArmMinimize == False:
|
||||
if wrd.ArmMinimize == False:
|
||||
f.write("project.addDefine('WITH_JSON');\n")
|
||||
|
||||
if bpy.data.worlds['Arm'].ArmDeinterleavedBuffers == True:
|
||||
if wrd.ArmDeinterleavedBuffers == True:
|
||||
f.write("project.addDefine('WITH_DEINTERLEAVED');\n")
|
||||
|
||||
if bpy.data.worlds['Arm'].generate_gpu_skin == False:
|
||||
if wrd.generate_gpu_skin == False:
|
||||
f.write("project.addDefine('WITH_CPU_SKIN');\n")
|
||||
|
||||
for d in assets.khafile_defs:
|
||||
f.write("project.addDefine('" + d + "');\n")
|
||||
|
||||
config_text = bpy.data.worlds['Arm'].ArmKhafile
|
||||
config_text = wrd.ArmKhafile
|
||||
if config_text != '':
|
||||
f.write(bpy.data.texts[config_text].as_string())
|
||||
|
||||
|
|
|
@ -214,7 +214,8 @@ def parse_band_floats(irradiance_floats, band_line):
|
|||
|
||||
def write_sky_irradiance(base_name):
|
||||
# Predefined fake spherical harmonics for now
|
||||
irradiance_floats = [1.0281457342829743,1.1617608778901902,1.3886220898440544,-0.13044863139637752,-0.2794659158733846,-0.5736106907295643,0.04065421813873111,0.0434367391348577,0.03567450494792305,0.10964557605577738,0.1129839085793664,0.11261660812141877,-0.08271974283263238,-0.08068091195339556,-0.06432614970480094,-0.12517787967665814,-0.11638582546310804,-0.09743696224655113,0.20068697715947176,0.2158788783296805,0.2109374396869599,0.19636637427150455,0.19445523113118082,0.17825330699680575,0.31440860839538637,0.33041120060402407,0.30867788630062676]
|
||||
# irradiance_floats = [1.0281457342829743,1.1617608778901902,1.3886220898440544,-0.13044863139637752,-0.2794659158733846,-0.5736106907295643,0.04065421813873111,0.0434367391348577,0.03567450494792305,0.10964557605577738,0.1129839085793664,0.11261660812141877,-0.08271974283263238,-0.08068091195339556,-0.06432614970480094,-0.12517787967665814,-0.11638582546310804,-0.09743696224655113,0.20068697715947176,0.2158788783296805,0.2109374396869599,0.19636637427150455,0.19445523113118082,0.17825330699680575,0.31440860839538637,0.33041120060402407,0.30867788630062676]
|
||||
irradiance_floats = [0.5282714503101548,0.6576873502619733,1.0692444882409775,0.17108712865136044,-0.08840906601412168,-0.5016437779078063,-0.05123227009753221,-0.06724088656181595,-0.07651659183264257,-0.09740705087869408,-0.19569235551561795,-0.3087497307203731,0.056717192983076405,0.1109186355691673,0.20616582000220154,0.013898321643280141,0.05985657405787638,0.12638202463080392,-0.003224443014484806,0.013764449325286695,0.04288850064700093,0.1796545401960917,0.21595731080039757,0.29144356515614844,0.10152875101705996,0.2651761450155488,0.4778582813756466]
|
||||
# Hosek
|
||||
# irradiance_floats = [1.5519331988822218,2.3352207154503266,2.997277451988076,0.2673894962434794,0.4305630474135794,0.11331825259716752,-0.04453633521758638,-0.038753175134160295,-0.021302768541875794,0.00055858020486499,0.000371654770334503,0.000126606145406403,-0.000135708721978705,-0.000787399554583089,-0.001550090690860059,0.021947399048903773,0.05453650591711572,0.08783641266630278,0.17053593578630663,0.14734127083304463,0.07775404698816404,-2.6924363189795e-05,-7.9350169701934e-05,-7.559914435231e-05,0.27035455385870993,0.23122918445556914,0.12158817295211832]
|
||||
# for i in range(0, len(irradiance_floats)):
|
||||
|
|
|
@ -7,8 +7,8 @@ precision mediump float;
|
|||
uniform sampler2D tex;
|
||||
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
outColor = texture(tex, texCoord);
|
||||
fragColor = texture(tex, texCoord);
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ precision mediump float;
|
|||
uniform sampler2D tex;
|
||||
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
//const float bloomTreshold = 3.0;
|
||||
|
||||
|
@ -17,9 +17,9 @@ void main() {
|
|||
vec4 col = texture(tex, texCoord);
|
||||
float brightness = dot(col.rgb, vec3(0.2126, 0.7152, 0.0722));
|
||||
if (brightness > bloomTreshold) {
|
||||
outColor.rgb = vec3(col.rgb);
|
||||
fragColor.rgb = vec3(col.rgb);
|
||||
return;
|
||||
}
|
||||
|
||||
outColor.rgb = vec3(0.0);
|
||||
fragColor.rgb = vec3(0.0);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ uniform vec2 dir;
|
|||
uniform vec2 screenSize;
|
||||
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
vec2 unpackFloat(float f) {
|
||||
return vec2(floor(f) / 1000.0, fract(f));
|
||||
|
@ -24,7 +24,7 @@ void main() {
|
|||
vec2 tc = texCoord * ssrTextureScale;
|
||||
float roughness = unpackFloat(texture(gbuffer0, texCoord).b).y;
|
||||
// if (roughness == 0.0) { // Always blur for now, non blured output can produce noise
|
||||
// outColor = texture(tex, tc);
|
||||
// fragColor = texture(tex, tc);
|
||||
// return;
|
||||
// }
|
||||
|
||||
|
@ -45,5 +45,5 @@ void main() {
|
|||
// result /= vec3(11.0);
|
||||
result /= vec3(5.0);
|
||||
|
||||
outColor.rgb = vec3(result);
|
||||
fragColor.rgb = vec3(result);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ uniform vec2 dir;
|
|||
uniform vec2 screenSize;
|
||||
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
const float blurWeights[10] = float[] (0.132572, 0.125472, 0.106373, 0.08078, 0.05495, 0.033482, 0.018275, 0.008934, 0.003912, 0.001535);
|
||||
const float discardThreshold = 0.95;
|
||||
|
@ -66,7 +66,7 @@ void main() {
|
|||
// result += texture(tex, tc - (step * 3.5)).rgb;
|
||||
// result += texture(tex, tc - (step * 4.5)).rgb;
|
||||
// result /= vec3(9.0);
|
||||
// outColor.rgb = vec3(result);
|
||||
// fragColor.rgb = vec3(result);
|
||||
|
||||
vec3 nor = getNor(texture(gbuffer0, texCoord).rg);
|
||||
|
||||
|
@ -87,6 +87,6 @@ void main() {
|
|||
// }
|
||||
|
||||
result /= weight;
|
||||
// outColor = vec4(result.rgb, 1.0);
|
||||
outColor = vec4(result.rrr, 1.0); // SSAO only
|
||||
// fragColor = vec4(result.rgb, 1.0);
|
||||
fragColor = vec4(result.rrr, 1.0); // SSAO only
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ uniform vec2 dir;
|
|||
uniform vec2 screenSize;
|
||||
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
// const float weight[5] = float[] (0.227027, 0.1945946, 0.1216216, 0.054054, 0.016216);
|
||||
// const float weight[8] = float[] (0.197448, 0.174697, 0.120999, 0.065602, 0.02784, 0.009246, 0.002403, 0.000489);
|
||||
|
@ -39,5 +39,5 @@ void main() {
|
|||
result += texture(tex, texCoord + step * 7.5).rgb * weight[7] * bloomStrength;
|
||||
result += texture(tex, texCoord - step * 7.5).rgb * weight[7] * bloomStrength;
|
||||
|
||||
outColor.rgb = vec3(result);
|
||||
fragColor.rgb = vec3(result);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ uniform vec2 dir;
|
|||
uniform vec2 screenSize;
|
||||
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec2 step = dir / screenSize;
|
||||
|
@ -28,5 +28,5 @@ void main() {
|
|||
result += texture(tex, texCoord - (step * 5.5)).rgb;
|
||||
result /= vec3(11.0);
|
||||
|
||||
outColor.rgb = vec3(result);
|
||||
fragColor.rgb = vec3(result);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ uniform sampler2D tex;
|
|||
uniform sampler2D tex2;
|
||||
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
const float exposure = 1.0;
|
||||
const float gamma = 2.2;
|
||||
|
@ -25,7 +25,7 @@ void main() {
|
|||
|
||||
// Gamma correction
|
||||
// result = pow(result, vec3(1.0 / gamma));
|
||||
// outColor.rgb = result;
|
||||
// fragColor.rgb = result;
|
||||
|
||||
outColor.rgb = col;
|
||||
fragColor.rgb = col;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ in vec2 texCoord;
|
|||
#ifdef _CompoPos
|
||||
in vec3 viewRay;
|
||||
#endif
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
const float focus_depth = 0.5;
|
||||
|
||||
|
@ -311,5 +311,5 @@ void main() {
|
|||
col.rgb *= 1.0 - step(0.5 - compoLetterboxSize, abs(0.5 - texCoord.y));
|
||||
#endif
|
||||
|
||||
outColor = col;
|
||||
fragColor = col;
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@ precision mediump float;
|
|||
uniform sampler2D tex;
|
||||
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
outColor = texture(tex, texCoord);
|
||||
fragColor = texture(tex, texCoord);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ uniform vec3 eyeLook;
|
|||
|
||||
in vec2 texCoord;
|
||||
in vec3 viewRay;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
vec2 octahedronWrap(vec2 v) {
|
||||
return (1.0 - abs(v.yx)) * (vec2(v.x >= 0.0 ? 1.0 : -1.0, v.y >= 0.0 ? 1.0 : -1.0));
|
||||
|
@ -44,7 +44,7 @@ void main() {
|
|||
n.xy = n.z >= 0.0 ? enc.xy : octahedronWrap(enc.xy);
|
||||
n = normalize(n);
|
||||
|
||||
outColor = vec4(n * 0.5 + 0.5, 1.0);
|
||||
fragColor = vec4(n * 0.5 + 0.5, 1.0);
|
||||
|
||||
// vec3 p = getPos(depth);
|
||||
// vec3 baseColor = g1.rgb;
|
||||
|
|
|
@ -9,9 +9,9 @@ precision mediump float;
|
|||
uniform sampler2D tex;
|
||||
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 col = texture(tex, texCoord);
|
||||
outColor = vec4(col.r * 10.0, col.g * 10.0, 0.0, 1.0);
|
||||
fragColor = vec4(col.r * 10.0, col.g * 10.0, 0.0, 1.0);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ uniform mat4 V;
|
|||
in vec4 wvpposition;
|
||||
in vec4 matColor;
|
||||
// in vec3 orientation;
|
||||
out vec4[2] outColor;
|
||||
out vec4[2] fragColor;
|
||||
|
||||
mat3 cotangentFrame(vec3 nor, vec3 pos, vec2 uv) {
|
||||
// Get edge vectors of the pixel triangle
|
||||
|
@ -98,9 +98,9 @@ void main() {
|
|||
|
||||
// Alpha write is disabled in shader res, we acces all channels for blending
|
||||
// Use separate texture for base color in the future
|
||||
outColor[1].rgb = baseColor.rgb;
|
||||
outColor[1].a = baseColor.a;
|
||||
// outColor[1].a = packFloat(roughness, metalness) * baseColor.a;
|
||||
fragColor[1].rgb = baseColor.rgb;
|
||||
fragColor[1].a = baseColor.a;
|
||||
// fragColor[1].a = packFloat(roughness, metalness) * baseColor.a;
|
||||
|
||||
#ifdef _MetTex
|
||||
float metalness = texture(smetal, texCoord).r;
|
||||
|
@ -128,15 +128,15 @@ void main() {
|
|||
n /= (abs(n.x) + abs(n.y) + abs(n.z));
|
||||
n.xy = n.z >= 0.0 ? n.xy : octahedronWrap(n.xy);
|
||||
|
||||
outColor[0].rg = n.xy;
|
||||
fragColor[0].rg = n.xy;
|
||||
#else
|
||||
outColor[0].rg = vec2(1.0);
|
||||
fragColor[0].rg = vec2(1.0);
|
||||
#endif
|
||||
|
||||
// outColor[0].b unused for now so we can rewrite it
|
||||
outColor[0].b = 0.0;
|
||||
// fragColor[0].b unused for now so we can rewrite it
|
||||
fragColor[0].b = 0.0;
|
||||
// use separete RG texture for normal storage in the future
|
||||
// Color mask does not disable write for all buffers so mask is overwritten
|
||||
// Half of color alpha to soft normals blend
|
||||
outColor[0].a = baseColor.a / 2.0;
|
||||
fragColor[0].a = baseColor.a / 2.0;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ precision mediump float;
|
|||
// #endif
|
||||
|
||||
// in vec4 position;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
|
||||
|
@ -18,5 +18,5 @@ void main() {
|
|||
|
||||
// gl_FragDepth = depth;
|
||||
// gl_FragColor = vec4(depth, 0.0, 0.0, 1.0);
|
||||
outColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
|
|
|
@ -73,9 +73,9 @@ in vec4 matColor;
|
|||
#endif
|
||||
|
||||
#ifdef _Veloc
|
||||
out vec4[3] outColor;
|
||||
out vec4[3] fragColor;
|
||||
#else
|
||||
out vec4[2] outColor;
|
||||
out vec4[2] fragColor;
|
||||
#endif
|
||||
|
||||
float packFloat(float f1, float f2) {
|
||||
|
@ -260,15 +260,15 @@ void main() {
|
|||
mask_probe = probeID + clampres;
|
||||
}
|
||||
}
|
||||
outColor[0] = vec4(n.xy, packFloat(metalness, roughness), mask_probe);
|
||||
fragColor[0] = vec4(n.xy, packFloat(metalness, roughness), mask_probe);
|
||||
#else
|
||||
outColor[0] = vec4(n.xy, packFloat(metalness, roughness), mask);
|
||||
fragColor[0] = vec4(n.xy, packFloat(metalness, roughness), mask);
|
||||
#endif
|
||||
outColor[1] = vec4(baseColor.rgb, occ);
|
||||
fragColor[1] = vec4(baseColor.rgb, occ);
|
||||
|
||||
#ifdef _Veloc
|
||||
vec2 posa = (wvppos.xy / wvppos.w) * 0.5 + 0.5;
|
||||
vec2 posb = (prevwvppos.xy / prevwvppos.w) * 0.5 + 0.5;
|
||||
outColor[2].rg = vec2(posa - posb);
|
||||
fragColor[2].rg = vec2(posa - posb);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ in vec2 te_texCoord;
|
|||
in vec3 te_normal;
|
||||
#endif
|
||||
|
||||
out vec4[2] outColor;
|
||||
out vec4[2] fragColor;
|
||||
|
||||
float packFloat(float f1, float f2) {
|
||||
float index = floor(f1 * 1000.0); // Temporary
|
||||
|
@ -100,6 +100,6 @@ void main() {
|
|||
n /= (abs(n.x) + abs(n.y) + abs(n.z));
|
||||
n.xy = n.z >= 0.0 ? n.xy : octahedronWrap(n.xy);
|
||||
|
||||
outColor[0] = vec4(n.xy, packFloat(metalness, roughness), mask);
|
||||
outColor[1] = vec4(baseColor.rgb, occ);
|
||||
fragColor[0] = vec4(n.xy, packFloat(metalness, roughness), mask);
|
||||
fragColor[1] = vec4(baseColor.rgb, occ);
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ in vec3 eyeDir;
|
|||
#else
|
||||
in vec3 normal;
|
||||
#endif
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
#ifndef _NoShadows
|
||||
// float linstep(float low, float high, float v) {
|
||||
|
@ -606,9 +606,9 @@ void main() {
|
|||
sf = step(0.5, sf);
|
||||
}
|
||||
|
||||
outColor.rgb = ambientMaterial + (df * diffuseMaterial + sf * specularMaterial) * visibility;
|
||||
fragColor.rgb = ambientMaterial + (df * diffuseMaterial + sf * specularMaterial) * visibility;
|
||||
float edgeDetection = (dot(v, n) < 0.1) ? 0.0 : 1.0;
|
||||
outColor.rgb *= edgeDetection;
|
||||
fragColor.rgb *= edgeDetection;
|
||||
|
||||
// const int levels = 4;
|
||||
// const float scaleFactor = 1.0 / levels;
|
||||
|
@ -626,7 +626,7 @@ void main() {
|
|||
// float specMask = (pow(dot(h, n), shininess) > 0.4) ? 1.0 : 0.0;
|
||||
|
||||
// float edgeDetection = (dot(v, n) > 0.3) ? 1.0 : 0.0;
|
||||
// outColor.rgb = edgeDetection * ((diffuseColor + specular * specMask) * visibility + ambientMaterial);
|
||||
// fragColor.rgb = edgeDetection * ((diffuseColor + specular * specMask) * visibility + ambientMaterial);
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -682,20 +682,20 @@ void main() {
|
|||
indirect += indirectSpecular;
|
||||
#endif
|
||||
indirect = indirect * envmapStrength; // * lightColor * lightStrength;
|
||||
outColor = vec4(vec3(direct * visibility + indirect), 1.0);
|
||||
fragColor = vec4(vec3(direct * visibility + indirect), 1.0);
|
||||
|
||||
#ifdef _OccTex
|
||||
vec3 occ = texture(socclusion, texCoord).rgb;
|
||||
outColor.rgb *= occ;
|
||||
fragColor.rgb *= occ;
|
||||
#else
|
||||
outColor.rgb *= occlusion;
|
||||
fragColor.rgb *= occlusion;
|
||||
#endif
|
||||
// LTC
|
||||
// outColor.rgb = ltccol * 10.0 * visibility + indirect / 14.0;
|
||||
// fragColor.rgb = ltccol * 10.0 * visibility + indirect / 14.0;
|
||||
|
||||
#ifdef _LDR
|
||||
outColor.rgb = vec3(pow(outColor.rgb, vec3(1.0 / 2.2)));
|
||||
fragColor.rgb = vec3(pow(fragColor.rgb, vec3(1.0 / 2.2)));
|
||||
// #else
|
||||
// outColor = vec4(outColor.rgb, outColor.a);
|
||||
// fragColor = vec4(fragColor.rgb, fragColor.a);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ precision mediump float;
|
|||
#endif
|
||||
|
||||
// in vec4 position;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
|
||||
|
@ -18,7 +18,7 @@ void main() {
|
|||
|
||||
// gl_FragDepth = depth;
|
||||
// gl_FragColor = vec4(depth, 0.0, 0.0, 1.0);
|
||||
outColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
|
||||
// VSM
|
||||
// float dx = dFdx(depth);
|
||||
|
|
|
@ -8,8 +8,8 @@ precision mediump float;
|
|||
#define _BaseTex
|
||||
#endif
|
||||
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
outColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ in vec3 eyeDir;
|
|||
#else
|
||||
in vec3 normal;
|
||||
#endif
|
||||
out vec4[2] outColor;
|
||||
out vec4[2] fragColor;
|
||||
|
||||
vec3 shIrradiance(vec3 nor, float scale) {
|
||||
const float c1 = 0.429043;
|
||||
|
@ -200,6 +200,10 @@ void main() {
|
|||
roughness *= roughnessStrength;
|
||||
#endif
|
||||
|
||||
#ifdef _OccTex
|
||||
float occlusion = texture(socclusion, texCoord).r;
|
||||
#endif
|
||||
|
||||
// Direct
|
||||
vec3 direct = diffuseBRDF(albedo, roughness, dotNV, dotNL, dotVH, dotLV) + specularBRDF(f0, roughness, dotNL, dotNH, dotNV, dotVH, dotLH);
|
||||
|
||||
|
@ -248,6 +252,6 @@ void main() {
|
|||
// revealage = premultipliedReflect.a;
|
||||
// RT0 = vec4(C * w, a)
|
||||
// RT1 = vec4(vec3(a * w), 1)
|
||||
outColor[0] = vec4(premultipliedReflect.rgb * w, premultipliedReflect.a);
|
||||
outColor[1] = vec4(premultipliedReflect.a * w, 0.0, 0.0, 1.0);
|
||||
fragColor[0] = vec4(premultipliedReflect.rgb * w, premultipliedReflect.a);
|
||||
fragColor[1] = vec4(premultipliedReflect.a * w, 0.0, 0.0, 1.0);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ in vec2 texCoord;
|
|||
#ifdef _Rad
|
||||
in vec3 viewRay;
|
||||
#endif
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
#ifdef _Rad
|
||||
float getMipLevelFromRoughness(float roughness) {
|
||||
|
@ -233,5 +233,5 @@ void main() {
|
|||
indirect *= texture(ssaotex, texCoord).r; // SSAO
|
||||
#endif
|
||||
|
||||
outColor.rgb = indirect;
|
||||
fragColor.rgb = indirect;
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ uniform vec3 eye;
|
|||
// in vec2 texCoord;
|
||||
in vec4 wvpposition;
|
||||
// in vec3 viewRay;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
// Separable SSS Transmittance Function, ref to sss_pass
|
||||
#ifdef _SSS
|
||||
|
@ -795,7 +795,7 @@ void main() {
|
|||
#endif
|
||||
|
||||
// Direct
|
||||
outColor = vec4(vec3(direct * visibility), 1.0);
|
||||
fragColor = vec4(vec3(direct * visibility), 1.0);
|
||||
|
||||
// Voxels test..
|
||||
#ifdef _VoxelGI
|
||||
|
@ -828,13 +828,13 @@ void main() {
|
|||
|
||||
vec3 indirect1 = indirectDiffusea * diffOcclusion + indirectSpecular;
|
||||
indirect1 *= texture(ssaotex, texCoord).r;
|
||||
outColor.rgb += indirect1;
|
||||
fragColor.rgb += indirect1;
|
||||
#endif
|
||||
|
||||
|
||||
// LTC
|
||||
// float sinval = (sin(time) * 0.5 + 0.5);
|
||||
// vec4 outColor = vec4(1.0);
|
||||
// vec4 fragColor = vec4(1.0);
|
||||
// float rectSizeX = 4.000 + sin(time) * 4.0;
|
||||
// float rectSizeY = 1.2;// + sin(time * 2.0);
|
||||
// vec3 ex = vec3(1, 0, 0)*rectSizeX;
|
||||
|
@ -861,10 +861,10 @@ void main() {
|
|||
// ltcdiff *= vec3(1.0, 1.0 - sinval, 1.0 - sinval);
|
||||
// vec3 ltccol = ltcspec + ltcdiff * albedo;
|
||||
// ltccol /= 2.0*PI;
|
||||
// outColor.rgb = ltccol * 5.0 * visibility + (indirect / 14.0 * ao * (rectSizeX / 6.0) );
|
||||
// // outColor.rgb = ltccol * visibility + (indirect / 2.0 * ao);
|
||||
// fragColor.rgb = ltccol * 5.0 * visibility + (indirect / 14.0 * ao * (rectSizeX / 6.0) );
|
||||
// // fragColor.rgb = ltccol * visibility + (indirect / 2.0 * ao);
|
||||
|
||||
// outColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a);
|
||||
// outputColor = vec4(outColor.rgb, outColor.a);
|
||||
//gl_FragColor = vec4(outColor.rgb, outColor.a);
|
||||
// fragColor = vec4(pow(fragColor.rgb, vec3(1.0 / 2.2)), fragColor.a);
|
||||
// outputColor = vec4(fragColor.rgb, fragColor.a);
|
||||
//gl_FragColor = vec4(fragColor.rgb, fragColor.a);
|
||||
}
|
||||
|
|
4
raw/env/env.frag.glsl
vendored
4
raw/env/env.frag.glsl
vendored
|
@ -38,7 +38,7 @@ uniform float envmapStrength; // From world material
|
|||
|
||||
// in vec2 texCoord;
|
||||
in vec3 normal;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
#ifdef _EnvSky
|
||||
vec3 hosekWilkie(float cos_theta, float gamma, float cos_gamma) {
|
||||
|
@ -223,5 +223,5 @@ void main() {
|
|||
R = pow(R, vec3(1.0 / 2.2));
|
||||
#endif
|
||||
|
||||
outColor = vec4(R, 1.0);
|
||||
fragColor = vec4(R, 1.0);
|
||||
}
|
||||
|
|
|
@ -116,7 +116,7 @@ in vec3 eyeDir;
|
|||
#else
|
||||
in vec3 normal;
|
||||
#endif
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
#ifndef _NoShadows
|
||||
#ifndef _PCSS
|
||||
|
@ -859,9 +859,9 @@ void main() {
|
|||
// sf = step(0.5, sf);
|
||||
// }
|
||||
|
||||
// outColor.rgb = ambientMaterial + (df * diffuseMaterial + sf * specularMaterial) * visibility;
|
||||
// fragColor.rgb = ambientMaterial + (df * diffuseMaterial + sf * specularMaterial) * visibility;
|
||||
// float edgeDetection = (dot(v, n) < 0.1) ? 0.0 : 1.0;
|
||||
// outColor.rgb *= edgeDetection;
|
||||
// fragColor.rgb *= edgeDetection;
|
||||
|
||||
// // const int levels = 4;
|
||||
// // const float scaleFactor = 1.0 / levels;
|
||||
|
@ -879,7 +879,7 @@ void main() {
|
|||
// // float specMask = (pow(dot(h, n), shininess) > 0.4) ? 1.0 : 0.0;
|
||||
|
||||
// // float edgeDetection = (dot(v, n) > 0.3) ? 1.0 : 0.0;
|
||||
// // outColor.rgb = edgeDetection * ((diffuseColor + specular * specMask) * visibility + ambientMaterial);
|
||||
// // fragColor.rgb = edgeDetection * ((diffuseColor + specular * specMask) * visibility + ambientMaterial);
|
||||
// #endif
|
||||
|
||||
|
||||
|
@ -979,26 +979,26 @@ void main() {
|
|||
|
||||
#endif
|
||||
|
||||
outColor = vec4(vec3(direct * visibility + indirect), 1.0);
|
||||
fragColor = vec4(vec3(direct * visibility + indirect), 1.0);
|
||||
|
||||
|
||||
#ifdef _OccTex
|
||||
vec3 occ = texture(socclusion, texCoord).rgb;
|
||||
outColor.rgb *= occ;
|
||||
fragColor.rgb *= occ;
|
||||
#else
|
||||
outColor.rgb *= occlusion;
|
||||
fragColor.rgb *= occlusion;
|
||||
#endif
|
||||
|
||||
|
||||
// LTC
|
||||
// outColor.rgb = ltccol * 10.0 * visibility + indirect / 14.0;
|
||||
// fragColor.rgb = ltccol * 10.0 * visibility + indirect / 14.0;
|
||||
|
||||
|
||||
#ifdef _LDR
|
||||
// gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a);
|
||||
outColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a);
|
||||
// gl_FragColor = vec4(pow(fragColor.rgb, vec3(1.0 / 2.2)), fragColor.a);
|
||||
fragColor = vec4(pow(fragColor.rgb, vec3(1.0 / 2.2)), fragColor.a);
|
||||
// #else
|
||||
// gl_FragColor = vec4(outColor.rgb, outColor.a);
|
||||
//outColor = vec4(outColor.rgb, outColor.a);
|
||||
// gl_FragColor = vec4(fragColor.rgb, fragColor.a);
|
||||
//fragColor = vec4(fragColor.rgb, fragColor.a);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ in vec3 eyeDir;
|
|||
#else
|
||||
in vec3 normal;
|
||||
#endif
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
#ifndef _NoShadows
|
||||
// float linstep(float low, float high, float v) {
|
||||
|
@ -605,9 +605,9 @@ void main() {
|
|||
sf = step(0.5, sf);
|
||||
}
|
||||
|
||||
outColor.rgb = ambientMaterial + (df * diffuseMaterial + sf * specularMaterial) * visibility;
|
||||
fragColor.rgb = ambientMaterial + (df * diffuseMaterial + sf * specularMaterial) * visibility;
|
||||
float edgeDetection = (dot(v, n) < 0.1) ? 0.0 : 1.0;
|
||||
outColor.rgb *= edgeDetection;
|
||||
fragColor.rgb *= edgeDetection;
|
||||
|
||||
// const int levels = 4;
|
||||
// const float scaleFactor = 1.0 / levels;
|
||||
|
@ -625,7 +625,7 @@ void main() {
|
|||
// float specMask = (pow(dot(h, n), shininess) > 0.4) ? 1.0 : 0.0;
|
||||
|
||||
// float edgeDetection = (dot(v, n) > 0.3) ? 1.0 : 0.0;
|
||||
// outColor.rgb = edgeDetection * ((diffuseColor + specular * specMask) * visibility + ambientMaterial);
|
||||
// fragColor.rgb = edgeDetection * ((diffuseColor + specular * specMask) * visibility + ambientMaterial);
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -681,20 +681,20 @@ void main() {
|
|||
indirect += indirectSpecular;
|
||||
#endif
|
||||
indirect = indirect * lightColor * lightStrength * envmapStrength;
|
||||
outColor = vec4(vec3(direct * visibility + indirect), 1.0);
|
||||
fragColor = vec4(vec3(direct * visibility + indirect), 1.0);
|
||||
|
||||
#ifdef _OccTex
|
||||
vec3 occ = texture(socclusion, texCoord).rgb;
|
||||
outColor.rgb *= occ;
|
||||
fragColor.rgb *= occ;
|
||||
#else
|
||||
outColor.rgb *= occlusion;
|
||||
fragColor.rgb *= occlusion;
|
||||
#endif
|
||||
// LTC
|
||||
// outColor.rgb = ltccol * 10.0 * visibility + indirect / 14.0;
|
||||
// fragColor.rgb = ltccol * 10.0 * visibility + indirect / 14.0;
|
||||
|
||||
#ifdef _LDR
|
||||
outColor.rgb = vec3(pow(outColor.rgb, vec3(1.0 / 2.2)));
|
||||
fragColor.rgb = vec3(pow(fragColor.rgb, vec3(1.0 / 2.2)));
|
||||
// #else
|
||||
// outColor = vec4(outColor.rgb, outColor.a);
|
||||
// fragColor = vec4(fragColor.rgb, fragColor.a);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ precision mediump float;
|
|||
#endif
|
||||
|
||||
// in vec4 position;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
|
||||
|
@ -18,7 +18,7 @@ void main() {
|
|||
|
||||
// gl_FragDepth = depth;
|
||||
// gl_FragColor = vec4(depth, 0.0, 0.0, 1.0);
|
||||
outColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
|
||||
// VSM
|
||||
// float dx = dFdx(depth);
|
||||
|
|
|
@ -8,7 +8,7 @@ uniform sampler2D tex;
|
|||
uniform vec2 texStep; // screenSizeInv
|
||||
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
const float FXAA_REDUCE_MIN = 1.0 / 128.0;
|
||||
|
@ -56,6 +56,6 @@ void main() {
|
|||
texture(tex, texCoord + dir * 0.5).rgb);
|
||||
|
||||
float lumaB = dot(rgbB, luma);
|
||||
if ((lumaB < lumaMin) || (lumaB > lumaMax)) outColor = vec4(rgbA, texColor.a);
|
||||
else outColor = vec4(rgbB, texColor.a);
|
||||
if ((lumaB < lumaMin) || (lumaB > lumaMax)) fragColor = vec4(rgbA, texColor.a);
|
||||
else fragColor = vec4(rgbB, texColor.a);
|
||||
}
|
||||
|
|
|
@ -6,8 +6,8 @@ precision mediump float;
|
|||
|
||||
in vec4 color;
|
||||
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
outColor = color;
|
||||
fragColor = color;
|
||||
}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
precision mediump float;
|
||||
#endif
|
||||
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
outColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
precision mediump float;
|
||||
#endif
|
||||
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
outColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ in vec3 eyeDir;
|
|||
#else
|
||||
in vec3 normal;
|
||||
#endif
|
||||
out vec4[2] outColor;
|
||||
out vec4[2] fragColor;
|
||||
|
||||
#ifndef _NoShadows
|
||||
#ifndef _PCSS
|
||||
|
@ -597,12 +597,12 @@ void main() {
|
|||
|
||||
#ifdef _LDR
|
||||
outputColor.rgb = tonemapUncharted2(outputColor.rgb);
|
||||
outColor[0] = vec4(pow(outputColor.rgb, vec3(1.0 / 2.2)), visibility);
|
||||
fragColor[0] = vec4(pow(outputColor.rgb, vec3(1.0 / 2.2)), visibility);
|
||||
#else
|
||||
outColor[0] = vec4(outputColor.rgb, visibility);
|
||||
fragColor[0] = vec4(outputColor.rgb, visibility);
|
||||
#endif
|
||||
|
||||
n /= (abs(n.x) + abs(n.y) + abs(n.z));
|
||||
n.xy = n.z >= 0.0 ? n.xy : octahedronWrap(n.xy);
|
||||
outColor[1] = vec4(n.xy, packFloat(metalness, roughness), 0.0);
|
||||
fragColor[1] = vec4(n.xy, packFloat(metalness, roughness), 0.0);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ in vec3 eyeDir;
|
|||
#else
|
||||
in vec3 normal;
|
||||
#endif
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
#ifndef _NoShadows
|
||||
float texture2DCompare(vec2 uv, float compare) {
|
||||
|
@ -320,18 +320,18 @@ void main() {
|
|||
indirect += indirectSpecular;
|
||||
#endif
|
||||
indirect = indirect * lightColor * lightStrength * envmapStrength;
|
||||
outColor = vec4(vec3(direct * visibility + indirect), 1.0);
|
||||
fragColor = vec4(vec3(direct * visibility + indirect), 1.0);
|
||||
|
||||
#ifdef _OccTex
|
||||
vec3 occ = texture(socclusion, texCoord).rgb;
|
||||
outColor.rgb *= occ;
|
||||
fragColor.rgb *= occ;
|
||||
#else
|
||||
outColor.rgb *= occlusion;
|
||||
fragColor.rgb *= occlusion;
|
||||
#endif
|
||||
|
||||
#ifdef _LDR
|
||||
outColor.rgb = vec3(pow(outColor.rgb, vec3(1.0 / 2.2)));
|
||||
fragColor.rgb = vec3(pow(fragColor.rgb, vec3(1.0 / 2.2)));
|
||||
// #else
|
||||
// outColor = vec4(outColor.rgb, outColor.a);
|
||||
// fragColor = vec4(fragColor.rgb, fragColor.a);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
precision mediump float;
|
||||
#endif
|
||||
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
outColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ uniform sampler2D tex;
|
|||
uniform sampler2D gbufferD;
|
||||
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
const float decay = 0.96815;
|
||||
|
@ -30,5 +30,5 @@ void main() {
|
|||
color *= illuminationDecay * weight;
|
||||
illuminationDecay *= decay;
|
||||
}
|
||||
outColor = color;
|
||||
fragColor = color;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ uniform vec3 eyeLook;
|
|||
|
||||
in vec2 texCoord;
|
||||
in vec3 viewRay;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
// const float motionBlurIntensity = 1.0;
|
||||
// const int samples = 8;
|
||||
|
@ -47,13 +47,13 @@ void main() {
|
|||
|
||||
// Do not blur masked objects
|
||||
if (texture(gbuffer0, texCoord).a == 1.0) {
|
||||
outColor = color;
|
||||
fragColor = color;
|
||||
return;
|
||||
}
|
||||
|
||||
float depth = texture(gbufferD, texCoord).r * 2.0 - 1.0;
|
||||
if (depth == 1.0) {
|
||||
outColor = color;
|
||||
fragColor = color;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -114,5 +114,5 @@ void main() {
|
|||
// }
|
||||
|
||||
vec4 finalColor = color / processed;
|
||||
outColor = finalColor;
|
||||
fragColor = finalColor;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ uniform sampler2D tex;
|
|||
// uniform vec2 texStep;
|
||||
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec2 velocity = texture(sveloc, texCoord).rg;
|
||||
|
@ -25,7 +25,7 @@ void main() {
|
|||
|
||||
// Do not blur masked objects
|
||||
if (texture(gbuffer0, texCoord).a == 1.0) {
|
||||
outColor = col;
|
||||
fragColor = col;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -55,5 +55,5 @@ void main() {
|
|||
// }
|
||||
col /= float(samples + 1);
|
||||
|
||||
outColor = col;
|
||||
fragColor = col;
|
||||
}
|
||||
|
|
|
@ -7,9 +7,9 @@ precision mediump float;
|
|||
uniform sampler2D gbuffer;
|
||||
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec3 col = texture(gbuffer, texCoord).rgb;
|
||||
outColor = vec4(col, 1.0);
|
||||
fragColor = vec4(col, 1.0);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ precision mediump float;
|
|||
#endif
|
||||
in vec3 initialRay;
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
uniform vec3 eye;
|
||||
//uniform float textureWeight;
|
||||
uniform float timeSinceStart;
|
||||
|
@ -192,6 +192,6 @@ time += 0.35;
|
|||
|
||||
//}
|
||||
|
||||
outColor = vec4(vec3(col / samples), 1.0);
|
||||
outColor.rgb = pow(outColor.rgb * 0.7, vec3(1.0 / 2.2));
|
||||
fragColor = vec4(vec3(col / samples), 1.0);
|
||||
fragColor.rgb = pow(fragColor.rgb * 0.7, vec3(1.0 / 2.2));
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ in vec2 pixcoord;
|
|||
in vec4 offset0;
|
||||
in vec4 offset1;
|
||||
in vec4 offset2;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
// Blending Weight Calculation Pixel Shader (Second Pass)
|
||||
vec2 cdw_end;
|
||||
|
@ -727,6 +727,6 @@ vec4 SMAABlendingWeightCalculationPS(vec2 texcoord, vec2 pixcoord, /*vec4 offset
|
|||
}
|
||||
|
||||
void main() {
|
||||
outColor = SMAABlendingWeightCalculationPS(texCoord, pixcoord, /*offset,*/
|
||||
fragColor = SMAABlendingWeightCalculationPS(texCoord, pixcoord, /*offset,*/
|
||||
/*edgesTex, areaTex, searchTex,*/ vec4(0.0));
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ in vec2 texCoord;
|
|||
in vec4 offset0;
|
||||
in vec4 offset1;
|
||||
in vec4 offset2;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
// Misc functions
|
||||
// Gathers current pixel, and the top-left neighbors.
|
||||
|
@ -208,6 +208,6 @@ vec2 SMAAColorEdgeDetectionPS(vec2 texcoord/*, vec4 offset[3], sampler2D colorTe
|
|||
// }
|
||||
|
||||
void main() {
|
||||
// outColor.rg = SMAALumaEdgeDetectionPS(texCoord/*, offset, colorTex*/);
|
||||
outColor.rg = SMAAColorEdgeDetectionPS(texCoord/*, offset, colorTex*/);
|
||||
// fragColor.rg = SMAALumaEdgeDetectionPS(texCoord/*, offset, colorTex*/);
|
||||
fragColor.rg = SMAAColorEdgeDetectionPS(texCoord/*, offset, colorTex*/);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ uniform vec2 screenSizeInv;
|
|||
|
||||
in vec2 texCoord;
|
||||
in vec4 offset;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Neighborhood Blending Pixel Shader (Third Pass)
|
||||
|
@ -97,5 +97,5 @@ vec4 SMAANeighborhoodBlendingPS(vec2 texcoord, vec4 offset/*, sampler2D colorTex
|
|||
}
|
||||
|
||||
void main() {
|
||||
outColor = SMAANeighborhoodBlendingPS(texCoord, offset/*, colorTex, blendTex*/);
|
||||
fragColor = SMAANeighborhoodBlendingPS(texCoord, offset/*, colorTex, blendTex*/);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ uniform vec2 aspectRatio;
|
|||
|
||||
in vec2 texCoord;
|
||||
// in vec3 viewRay;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
// float rand(vec2 co) { // Unreliable
|
||||
// return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);
|
||||
|
@ -82,7 +82,7 @@ float doAO(vec2 kernelVec, vec2 randomVec, mat2 rotMat, vec3 currentPos, vec3 cu
|
|||
void main() {
|
||||
float depth = texture(gbufferD, texCoord).r * 2.0 - 1.0;
|
||||
if (depth == 1.0) {
|
||||
outColor = vec4(1.0);
|
||||
fragColor = vec4(1.0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -160,5 +160,5 @@ void main() {
|
|||
amount *= ssaoStrength / kernelSize;
|
||||
amount = 1.0 - amount;
|
||||
amount = max(0.0, amount);
|
||||
outColor = vec4(amount, 0.0, 0.0, 1.0);
|
||||
fragColor = vec4(amount, 0.0, 0.0, 1.0);
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ uniform vec2 aspectRatio;
|
|||
|
||||
in vec2 texCoord;
|
||||
in vec3 viewRay;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
// float rand(vec2 co) { // Unreliable
|
||||
// return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);
|
||||
|
@ -84,7 +84,7 @@ float doAO(vec2 kernelVec, vec2 randomVec, mat2 rotMat, vec3 currentPos, vec3 cu
|
|||
void main() {
|
||||
float depth = texture(gbufferD, texCoord).r * 2.0 - 1.0;
|
||||
if (depth == 1.0) {
|
||||
outColor = vec4(1.0);
|
||||
fragColor = vec4(1.0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -162,10 +162,10 @@ void main() {
|
|||
amount *= ssaoStrength / kernelSize;
|
||||
amount = 1.0 - amount;
|
||||
amount = max(0.0, amount);
|
||||
// outColor = vec4(amount, 0.0, 0.0, 1.0);
|
||||
// fragColor = vec4(amount, 0.0, 0.0, 1.0);
|
||||
|
||||
// Velocity is assumed to be calculated for motion blur, so we need to inverse it for reprojection
|
||||
vec2 velocity = -textureLod(sveloc, texCoord, 0.0).rg;
|
||||
float last = texture(slast, texCoord + velocity).r;
|
||||
outColor = vec4((amount + last) * 0.5, 0.0, 0.0, 1.0);
|
||||
fragColor = vec4((amount + last) * 0.5, 0.0, 0.0, 1.0);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ const vec3 sh2_weight_l1 = vec3(fudge_factor_l1 * 0.48860); //0.5*sqrt(3.0/pi);
|
|||
const vec4 sh2_weight = vec4(sh2_weight_l1, sh2_weight_l0) / num_samples;
|
||||
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
vec2 octahedronWrap(vec2 v) {
|
||||
return (1.0 - abs(v.yx)) * (vec2(v.x >= 0.0 ? 1.0 : -1.0, v.y >= 0.0 ? 1.0 : -1.0));
|
||||
|
@ -65,7 +65,7 @@ void main() {
|
|||
float depth = texture(gbufferD, texCoord).r * 2.0 - 1.0;
|
||||
// if (depth == 0.0) {
|
||||
if (depth == 1.0) {
|
||||
outColor = vec4(1.0);
|
||||
fragColor = vec4(1.0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -161,5 +161,5 @@ void main() {
|
|||
occlusion_sh2 += doDO(points[31], noise, radius, center_pos, max_distance_inv, center_normal);
|
||||
// }
|
||||
|
||||
outColor = vec4(vec3(1.0 - occlusion_sh2.rgb), 1.0);
|
||||
fragColor = vec4(vec3(1.0 - occlusion_sh2.rgb), 1.0);
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ uniform mat4 tiV;
|
|||
|
||||
in vec3 viewRay;
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
vec3 hitCoord;
|
||||
float depth;
|
||||
|
@ -190,14 +190,14 @@ void main() {
|
|||
float roughness = unpackFloat(g0.b).y;
|
||||
|
||||
if (roughness == 1.0) {
|
||||
outColor = vec4(0.0);
|
||||
fragColor = vec4(0.0);
|
||||
return;
|
||||
}
|
||||
float reflectivity = 1.0 - roughness;
|
||||
|
||||
float d = texture(gbufferD, texCoord).r * 2.0 - 1.0;
|
||||
if (d == 1.0) {
|
||||
outColor = vec4(0.0);
|
||||
fragColor = vec4(0.0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -209,8 +209,8 @@ void main() {
|
|||
|
||||
vec4 viewNormal = vec4(n, 1.0);
|
||||
// if (viewNormal.z <= 0.9) {
|
||||
// outColor = texture(tex, texCoord);
|
||||
// outColor = vec4(0.0);
|
||||
// fragColor = texture(tex, texCoord);
|
||||
// fragColor = vec4(0.0);
|
||||
// return;
|
||||
// discard; // Only up facing surfaces for now
|
||||
// }
|
||||
|
@ -236,12 +236,12 @@ void main() {
|
|||
intensity = clamp(intensity, 0.0, 1.0);
|
||||
|
||||
if (intensity == 0.0) {
|
||||
outColor = vec4(0.0);
|
||||
fragColor = vec4(0.0);
|
||||
return;
|
||||
}
|
||||
|
||||
vec4 reflCol = vec4(texture(tex, coords.xy).rgb, 1.0);
|
||||
reflCol = clamp(reflCol, 0.0, 1.0);
|
||||
// outColor = texColor * (1.0 - intensity) + reflCol * intensity;
|
||||
outColor = reflCol * intensity; //
|
||||
// fragColor = texColor * (1.0 - intensity) + reflCol * intensity;
|
||||
fragColor = reflCol * intensity; //
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ uniform sampler2D tex;
|
|||
uniform vec2 dir;
|
||||
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
const float SSSS_FOVY = 45.0;
|
||||
|
||||
|
@ -157,9 +157,9 @@ vec4 SSSSBlur(float sssWidth) {
|
|||
void main() {
|
||||
// SSS only masked objects
|
||||
if (texture(gbuffer0, texCoord).a == 2.0) {
|
||||
outColor = SSSSBlur(0.005);
|
||||
fragColor = SSSSBlur(0.005);
|
||||
}
|
||||
else {
|
||||
outColor = texture(tex, texCoord);
|
||||
fragColor = texture(tex, texCoord);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ uniform sampler2D sveloc;
|
|||
#endif
|
||||
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
const float SMAA_REPROJECTION_WEIGHT_SCALE = 30.0;
|
||||
|
||||
|
@ -34,9 +34,9 @@ void main() {
|
|||
float weight = 0.5 * clamp(1.0 - sqrt(delta) * SMAA_REPROJECTION_WEIGHT_SCALE, 0.0, 1.0);
|
||||
|
||||
// Blend the pixels according to the calculated weight:
|
||||
outColor.rgb = mix(current.rgb, previous.rgb, weight);
|
||||
fragColor.rgb = mix(current.rgb, previous.rgb, weight);
|
||||
#else
|
||||
vec4 previous = texture(tex2, texCoord);
|
||||
outColor = mix(current.rgb, previous.rgb, 0.5);
|
||||
fragColor = mix(current.rgb, previous.rgb, 0.5);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ uniform sampler2D gbuffer0; // saccum
|
|||
uniform sampler2D gbuffer1; // srevealage
|
||||
|
||||
in vec2 texCoord;
|
||||
out vec4 outColor;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 accum = texture(gbuffer0, texCoord);
|
||||
|
@ -24,8 +24,8 @@ void main() {
|
|||
float accumA = texture(gbuffer1, texCoord).r;
|
||||
// accum.a = texture(gbuffer1, texCoord).r;
|
||||
|
||||
// outColor = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), revealage);
|
||||
// fragColor = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), revealage);
|
||||
|
||||
const float epsilon = 0.00001;
|
||||
outColor = vec4(accum.rgb / max(accumA, epsilon), 1.0 - revealage);
|
||||
fragColor = vec4(accum.rgb / max(accumA, epsilon), 1.0 - revealage);
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue