diff --git a/source/perfontain/managers/gui/package.d b/source/perfontain/managers/gui/package.d index 7f4cd37..ef0fa65 100644 --- a/source/perfontain/managers/gui/package.d +++ b/source/perfontain/managers/gui/package.d @@ -182,13 +182,16 @@ private: void draw(SubMeshData data) { + PEstate.culling = false; // TODO: FIX GUI + scope (exit) + PEstate.culling = true; + auto mh = asRC(new MeshHolder(RENDER_GUI, data)); //mh.texs = (cast(Texture) ftex).sliceOne; { uint offset; short n; - glDisable(GL_CULL_FACE); for (auto cmd = nk__draw_begin(_ctx.ctx, &cmds); (cmd); (cmd) = nk__draw_next(cmd, &cmds, _ctx.ctx)) { @@ -235,11 +238,7 @@ private: } - //logger(`gui draw`); - PE.render.doDraw(_prog, RENDER_GUI, _proj, null, false); - glEnable(GL_CULL_FACE); - //logger(`gui draw 2`); } void drawPopups() diff --git a/source/perfontain/managers/render/drawinfo.d b/source/perfontain/managers/render/drawinfo.d index eebd3e6..a44944b 100644 --- a/source/perfontain/managers/render/drawinfo.d +++ b/source/perfontain/managers/render/drawinfo.d @@ -14,8 +14,6 @@ struct DrawInfo Matrix4 matrix; Vector4s scissor; - uint lightStart, lightEnd; - Color color = colorWhite; ushort id; @@ -23,8 +21,8 @@ struct DrawInfo package: static diff(string val, string cmp = `<`, string as = ``) { - return `if(` ~ as ~ `(a.` ~ val ~ `) != ` ~ as ~ `(b.` ~ val ~ `)) return ` - ~ as ~ `(a.` ~ val ~ `) ` ~ cmp ~ as ~ `(b.` ~ val ~ `);`; + return `if(` ~ as ~ `(a.` ~ val ~ `) != ` ~ as ~ `(b.` ~ val ~ `)) return ` ~ as ~ `(a.` ~ val ~ `) ` ~ cmp ~ as ~ `(b.` ~ val + ~ `);`; } static cmp(ref in DrawInfo a, ref in DrawInfo b) diff --git a/source/perfontain/managers/render/package.d b/source/perfontain/managers/render/package.d index f0029fb..9fdee9d 100644 --- a/source/perfontain/managers/render/package.d +++ b/source/perfontain/managers/render/package.d @@ -1,5 +1,4 @@ module perfontain.managers.render; - import std, perfontain, perfontain.opengl, perfontain.misc.draw; public import perfontain.managers.render.drawinfo; @@ -128,12 +127,6 @@ private: if (flags & PROG_DATA_SCISSOR) add(di.scissor.Vector4i); - if (flags & PROG_DATA_LIGHTS) - { - add(di.lightStart); - add(di.lightEnd); - } - arr[p .. $] = 0; assert(arr.length == (p + 15) / 16 * 16); diff --git a/source/perfontain/managers/scene/package.d b/source/perfontain/managers/scene/package.d index 1972a0e..3eff7f3 100644 --- a/source/perfontain/managers/scene/package.d +++ b/source/perfontain/managers/scene/package.d @@ -174,7 +174,7 @@ package(perfontain): void computeLights(Texture tex, Program compute, ushort bs) { - tex.imageBind(0, GL_WRITE_ONLY); + tex.imageBind(0, GL_READ_WRITE); compute.send(`proj_view_inversed`, _vp.inversed); compute.bind; @@ -189,7 +189,7 @@ package(perfontain): glDispatchCompute(sz.x, sz.y, 1); } - glMemoryBarrier(GL_TEXTURE_FETCH_BARRIER_BIT); + glMemoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT); } void clear(Vector2s size, uint flags) diff --git a/source/perfontain/managers/scene/renderdata.d b/source/perfontain/managers/scene/renderdata.d index e6e0b8e..e79e515 100644 --- a/source/perfontain/managers/scene/renderdata.d +++ b/source/perfontain/managers/scene/renderdata.d @@ -57,15 +57,14 @@ class SceneRenderData : RCounted } if (texShadowsDepth) - _draw.add(ShaderTexture.shadows, texShadowsDepth); - { - _compute = ProgramCreator(ProgramSource.light_compute).create; + _draw.add(ShaderTexture.shadows_depth, texShadowsDepth); } if (lightsFull) { _depth = ProgramCreator(ProgramSource.depth).create; + _compute = ProgramCreator(ProgramSource.light_compute).create; VertexBuffer vbo = new VertexBuffer; { @@ -92,12 +91,10 @@ class SceneRenderData : RCounted auto tex = new Texture(TEX_SHADOW_MAP, PEwindow._size, s); _lightsDepth = new RenderTarget(tex, null); - _compute.add(ShaderTexture.depth, tex); + _compute.add(ShaderTexture.lights_depth, tex); } _ind = new Texture(TEX_RED_UINT, PEwindow._size, s); - - _draw.add(ShaderTexture.lights, _ind); } } } @@ -140,6 +137,5 @@ private: RC!Texture _ind; RC!RenderTarget _lightsDepth, _shadowsDepth; - RC!Program _draw, _compute, _depth, _shadowsDepthProg; } diff --git a/source/perfontain/managers/settings/package.d b/source/perfontain/managers/settings/package.d index 446aaf2..b05ddcb 100644 --- a/source/perfontain/managers/settings/package.d +++ b/source/perfontain/managers/settings/package.d @@ -25,7 +25,7 @@ final class SettingsManager } catch (Exception e) { - logger.error!`cannot parse setting %s: %s`(name, e.msg); + logger.error!`cannot parse setting %s: %s`(name, e.msg); } } } @@ -56,7 +56,7 @@ final class SettingsManager mixin Setting!(bool, `fullscreen`, false); mixin Setting!(Lights, `lights`, Lights.global); - mixin Setting!(Shadows, `shadows`, Shadows.high); + mixin Setting!(Shadows, `shadows`, Shadows.medium); Tuple!(string, `user`, string, `pass`)[] accounts; private: diff --git a/source/perfontain/managers/state.d b/source/perfontain/managers/state.d index b8a389c..2107a38 100644 --- a/source/perfontain/managers/state.d +++ b/source/perfontain/managers/state.d @@ -1,16 +1,16 @@ module perfontain.managers.state; - -import std.array, core.bitop, perfontain, perfontain.opengl, perfontain.config, - perfontain.math.matrix, perfontain.misc; +import std.array, core.bitop, perfontain, perfontain.opengl, perfontain.config, perfontain.math.matrix, perfontain.misc; final class StateManager { this() { - culling = false; // TODO GUI TEST + culling = true; if (PE._msaaLevel > 0) + { msaa = true; + } } @property @@ -32,6 +32,14 @@ final class StateManager } } + void culling(bool b) + { + if (_culling != b) + { + disableEnable(GL_CULL_FACE, _culling = b); + } + } + bool msaa() { return _msaa; @@ -95,8 +103,7 @@ package(perfontain): if (_blending && _blendingMode != m) { auto modes = unpackModes(_blendingMode = m); - glBlendFuncSeparate(modes.front.blendingModeGL, - modes.back.blendingModeGL, GL_ONE, GL_ONE); + glBlendFuncSeparate(modes.front.blendingModeGL, modes.back.blendingModeGL, GL_ONE, GL_ONE); } } @@ -109,12 +116,6 @@ package(perfontain): } } - struct LayerInfo - { - uint tex, samp; - } - - LayerInfo[MAX_LAYERS] _texLayers; uint _pipeline, _vao, _prog; private: static disableEnable(uint v, bool b) @@ -133,14 +134,6 @@ private: } } - void culling(bool b) - { - if (_culling != b) - { - disableEnable(GL_CULL_FACE, _culling = b); - } - } - Vector2s _viewPort; ubyte _blendingMode; diff --git a/source/perfontain/managers/texture/texture.d b/source/perfontain/managers/texture/texture.d index d479487..1ba1281 100644 --- a/source/perfontain/managers/texture/texture.d +++ b/source/perfontain/managers/texture/texture.d @@ -27,7 +27,7 @@ final class Texture : RCounted { PE.textures.remove(this); - PEstate._texLayers.each!((ref a) => cas(a.tex, id, 0)); + //PEstate._texLayers.each!((ref a) => cas(a.tex, id, 0)); glDeleteTextures(1, &id); } @@ -100,8 +100,6 @@ final class Texture : RCounted const bind(ubyte idx) { - auto p = &PEstate._texLayers[idx]; - //if (set(p.samp, _samp._id)) { glBindSampler(idx, _samp._id); diff --git a/source/perfontain/misc/dxt.d b/source/perfontain/misc/dxt.d index 3ca5eed..a17e882 100644 --- a/source/perfontain/misc/dxt.d +++ b/source/perfontain/misc/dxt.d @@ -1,21 +1,11 @@ module perfontain.misc.dxt; - -import - std.range, - std.algorithm, - std.parallelism, - - stb.dxt, - stb.image, - - perfontain; - +import std.range, std.algorithm, std.parallelism, stb.dxt, stb.image, perfontain; auto dxtTranspType(in Image im) { enum D = 10; - return im[].any!(a => a.a > D && a.a < 255 - D) ? TEX_DXT_5 : TEX_DXT_5; + return im[].any!(a => a.a > D && a.a < 255 - D) ? TEX_DXT_5 : TEX_DXT_5; // FIXME: ?????? } auto makeTexInfo(in Image im, bool mipmaps = true) @@ -25,14 +15,12 @@ auto makeTexInfo(in Image im, bool mipmaps = true) auto makeTexInfo(in Image im, ubyte t, bool mipmaps = true) { - TextureInfo res = { t }; + TextureInfo res = {t}; auto useDXT = t <= TEX_DXT_5; - auto arr = mipmaps ? im.toMipmaps : (&im)[0..1]; + auto arr = mipmaps ? im.toMipmaps : (&im)[0 .. 1]; - res.levels = arr - .map!(a => TextureData(Vector2s(a.w, a.h), useDXT ? a.dxtCompress(t == TEX_DXT_5) : a[].toByte)) - .array; + res.levels = arr.map!(a => TextureData(Vector2s(a.w, a.h), useDXT ? a.dxtCompress(t == TEX_DXT_5) : a[].toByte)).array; return res; } diff --git a/source/perfontain/nodes/package.d b/source/perfontain/nodes/package.d index 0d78441..e6976e1 100644 --- a/source/perfontain/nodes/package.d +++ b/source/perfontain/nodes/package.d @@ -1,21 +1,6 @@ module perfontain.nodes; - -import - - std.stdio, - std.range, - std.algorithm, - - perfontain, - perfontain.vbo, - perfontain.mesh, - perfontain.misc, - perfontain.math.bbox, - perfontain.config, - perfontain.opengl, - perfontain.math.matrix, - perfontain.shader; - +import std.stdio, std.range, std.algorithm, perfontain, perfontain.vbo, perfontain.mesh, perfontain.misc, + perfontain.math.bbox, perfontain.config, perfontain.opengl, perfontain.math.matrix, perfontain.shader; class Node : RCounted { @@ -29,7 +14,7 @@ class Node : RCounted //const transBBox() { return bbox * matrix; } } - void draw(in DrawInfo *di) + void draw(in DrawInfo* di) { childs.each!(a => a.draw(di)); } @@ -48,11 +33,11 @@ struct FrameOrientation final class ObjecterNode : Node { - override void draw(in DrawInfo *di) + override void draw(in DrawInfo* di) { DrawInfo m; - if(oris.length) + if (oris.length) { auto step = (PE._tick * 2) % oris.back.time; @@ -73,9 +58,6 @@ final class ObjecterNode : Node } m.mh = mh; - - m.lightStart = lightStart; - m.lightEnd = lightEnd; m.id = id; m.flags = di.flags; @@ -90,7 +72,5 @@ final class ObjecterNode : Node RC!MeshHolder mh; Matrix4 matrix; - - uint lightStart, lightEnd; ushort id; } diff --git a/source/perfontain/opengl/package.d b/source/perfontain/opengl/package.d index a445c45..8ca0f34 100644 --- a/source/perfontain/opengl/package.d +++ b/source/perfontain/opengl/package.d @@ -21,7 +21,9 @@ string dumpArgs(A...)(A args) dump ~= dump ? `, ` : null; static if (isPointer!(typeof(e))) + { dump ~= format(`0x%X`, cast(size_t)e); + } else dump ~= e.to!string; } @@ -31,7 +33,7 @@ string dumpArgs(A...)(A args) void traceGL(A...)(string func, string file, uint line, A args) { - //logger.info3(`[trace] %s(%s)`, func, dumpArgs(args)); + //logger.info3!`[%s:%u] %s(%s)`(file, line, func, dumpArgs(args)); } void checkError(A...)(string func, string file, uint line, A args) diff --git a/source/perfontain/program/package.d b/source/perfontain/program/package.d index 34475ee..5cfb41d 100644 --- a/source/perfontain/program/package.d +++ b/source/perfontain/program/package.d @@ -7,7 +7,6 @@ enum PROG_DATA_MODEL = 1, PROG_DATA_COLOR = 2, PROG_DATA_NORMAL = 4, - PROG_DATA_LIGHTS = 8, PROG_DATA_SM_MAT = 16, PROG_DATA_SCISSOR = 32, } @@ -30,7 +29,6 @@ final class Program : RCounted tuple(`pe_transforms.transforms[0].color`, PROG_DATA_COLOR), tuple(`pe_transforms.transforms[0].normal`, PROG_DATA_NORMAL), tuple(`pe_transforms.transforms[0].scissor`, PROG_DATA_SCISSOR), - tuple(`pe_transforms.transforms[0].lightStart`, PROG_DATA_LIGHTS), ]; foreach (a; Attrs) diff --git a/source/perfontain/program/props.d b/source/perfontain/program/props.d index 33a5743..31d59ef 100644 --- a/source/perfontain/program/props.d +++ b/source/perfontain/program/props.d @@ -4,9 +4,8 @@ import std; enum ShaderTexture : ubyte { main, - depth, - lights, - shadows, + lights_depth, + shadows_depth, max } diff --git a/source/perfontain/sampler.d b/source/perfontain/sampler.d index f926ef6..a8cb735 100644 --- a/source/perfontain/sampler.d +++ b/source/perfontain/sampler.d @@ -11,13 +11,13 @@ final class Sampler : RCounted ~this() { - foreach (uint i, ref v; PEstate._texLayers) - { - if (v.samp == _id) - { - glBindSampler(i, v.samp = 0); - } - } + // foreach (uint i, ref v; PEstate._texLayers) + // { + // if (v.samp == _id) + // { + // glBindSampler(i, v.samp = 0); + // } + // } glDeleteSamplers(1, &_id); } diff --git a/source/perfontain/shader/res/draw.c b/source/perfontain/shader/res/draw.c index 7194bd4..a4b2bf4 100644 --- a/source/perfontain/shader/res/draw.c +++ b/source/perfontain/shader/res/draw.c @@ -1,4 +1,6 @@ use PASS_DATA +use PASS_DRAW_ID +use TRANS_COLOR LIGHTING_FULL use MODEL_MAT @@ -52,6 +54,8 @@ import misc if(u.a < 0.05) discard; + u *= TRANS.color; + LIGHTING_ENABLED calcLights(u.rgb); diff --git a/source/perfontain/shader/res/gui.c b/source/perfontain/shader/res/gui.c index eba9d7f..bab4cd5 100644 --- a/source/perfontain/shader/res/gui.c +++ b/source/perfontain/shader/res/gui.c @@ -2,7 +2,6 @@ import header use PASS_DATA use PASS_DRAW_ID - use TRANS_GUI import misc diff --git a/source/perfontain/shader/res/light_compute.c b/source/perfontain/shader/res/light_compute.c index 8acb879..2e5300e 100644 --- a/source/perfontain/shader/res/light_compute.c +++ b/source/perfontain/shader/res/light_compute.c @@ -4,7 +4,7 @@ precision highp uimage2D; layout(local_size_x = 32, local_size_y = 32) in; layout(r32ui, binding = 0) uniform writeonly uimage2D output_tex; -__TEX_ID__ uniform sampler2D pe_tex_depth; +__TEX_ID__ uniform sampler2D pe_tex_lights_depth; uniform mat4 proj_view_inversed; struct LightSource @@ -35,7 +35,7 @@ __SSBO_ID__ buffer pe_lights vec2 uv = vec2(coord) / vec2(VIEWPORT_SIZE); uint pixel = 0u; - float depth = texture(pe_tex_depth, uv).r; + float depth = texture(pe_tex_lights_depth, uv).r; if(depth < 0.99) { @@ -51,7 +51,9 @@ __SSBO_ID__ buffer pe_lights pixel = (pixel << 8) | uint(i + 1); if(pixel >= end) + { break; + } } } } diff --git a/source/perfontain/shader/res/lighting.c b/source/perfontain/shader/res/lighting.c index 0c7d163..5288f68 100644 --- a/source/perfontain/shader/res/lighting.c +++ b/source/perfontain/shader/res/lighting.c @@ -10,7 +10,7 @@ LIGHTING_FULL LightSource lights[]; }; - __TEX_ID__ uniform highp usampler2D pe_tex_lights; + layout(r32ui, binding = 0) uniform readonly highp uimage2D pe_tex_lights_indices; void calcLight(vec3 nn, vec3 P, inout vec3 res, uint idx) { @@ -31,8 +31,7 @@ void calcLights(inout vec3 c) LIGHTING_FULL vec3 P = vec3(pos.xyz / pos.w); - vec2 uv = gl_FragCoord.xy / vec2(VIEWPORT_SIZE); - uint value = texture(pe_tex_lights, uv).r; + uint value = imageLoad(pe_tex_lights_indices, ivec2(gl_FragCoord.xy)).r; for(int i = 0; i < 4; i++) { diff --git a/source/perfontain/shader/res/shadows.c b/source/perfontain/shader/res/shadows.c index 3670671..e5f77ac 100644 --- a/source/perfontain/shader/res/shadows.c +++ b/source/perfontain/shader/res/shadows.c @@ -1,4 +1,4 @@ -__TEX_ID__ uniform sampler2D pe_tex_shadows; +__TEX_ID__ uniform sampler2D pe_tex_shadows_depth; const float bias = 0.001, shadowFactor = 0.5; @@ -12,7 +12,7 @@ float lkup(vec3 coord) else BIAS = bias - return step(coord.z - BIAS, texture(pe_tex_shadows, coord.xy).x); + return step(coord.z - BIAS, texture(pe_tex_shadows_depth, coord.xy).x); } void calcShadows(vec4 pos, float value, inout vec3 color) diff --git a/source/ro/conv/map.d b/source/ro/conv/map.d index faae6ca..cbf7afc 100644 --- a/source/ro/conv/map.d +++ b/source/ro/conv/map.d @@ -111,7 +111,7 @@ private: foreach (ref m; ps) { - f.poses ~= RomPose(m, bb * (r.trans * m), 0, 0, cast(ushort)id); + f.poses ~= RomPose(m, bb * (r.trans * m), cast(ushort)id); _lights.push(f.poses.back.box); } @@ -199,25 +199,9 @@ private: void processLightsIndices(ref RomFile f) { - auto arr = _lights.calc(f.lightIndices); + f.lights = f.lights.indexed(_lights.used).array; // TODO: OPTIMIZE - foreach (i, p; arr) - { - auto k = cast(int)(i - f.floor.length); - - if (k >= 0) - { - f.poses[k].lightStart = p.front; - f.poses[k].lightEnd = p.back; - } - else - { - f.floor[i].lightStart = p.front; - f.floor[i].lightEnd = p.back; - } - } - - f.lights = f.lights.indexed(_lights.used).array; + f.lights.sort!((a, b) => a.range > b.range); // TODO: ?????? } void processFogEntries(ref RomFile f) @@ -325,56 +309,28 @@ struct LightsCalculator void push(ref in BBox obj) { - _indices.length++; - foreach (i, ref s; _arr) { if (s.box.collision(obj)) { s.used = true; - _indices.back ~= cast(ushort)i; } } } auto used() { - return _arr.enumerate + auto res = _arr.enumerate .filter!(a => a.value.used) - .map!(a => a.index); - } - - auto calc(ref ushort[] res) - { - // pointers to array elements - auto index = new ushort[]*[_indices.length]; - - // sort to find max lengths - makeIndex!((a, b) => a.length > b.length)(_indices, index); - - // unused lights - auto unused = _arr.enumerate - .filter!(a => !a.value.used) .map!(a => a.index) - .array - .assumeSorted; + .array; - foreach (sub; index.map!(a => *a)) + if (auto unused = _arr.length - res.length) { - foreach (ref k; sub) - { - k -= unused.lowerBound(k).length; - } - - if (!res.canFind(sub)) - { - res ~= sub; - } + logger.warning!`%u lights are unreachable`(unused); } - alias func = (a) { auto s = a.length ? cast(uint)res.countUntil(a) : 0; return [s, s + cast(uint)a.length]; }; - - return _indices.map!func.array; + return res; } private: @@ -385,5 +341,4 @@ private: } Light[] _arr; - ushort[][] _indices; } diff --git a/source/ro/conv/package.d b/source/ro/conv/package.d index 55e2e9f..2e60d4c 100644 --- a/source/ro/conv/package.d +++ b/source/ro/conv/package.d @@ -1,8 +1,7 @@ module ro.conv; -import std.file, std.format, std.path, std.conv, std.range, std.getopt, - std.process, std.digest.md, core.memory, perfontain, perfontain.misc, - ro.conv.asp, ro.conv.map, ro.conv.gui, ro.conv.all, ro.conv.item, - ro.conv.effect, rocl.rofs, rocl.game, ro.paths; +import std.file, std.format, std.path, std.conv, std.range, std.getopt, std.process, std.digest.md, core.memory, + perfontain, perfontain.misc, ro.conv.asp, ro.conv.map, ro.conv.gui, ro.conv.all, ro.conv.item, ro.conv.effect, + rocl.rofs, rocl.game, ro.paths; package: @@ -16,16 +15,19 @@ abstract class Converter(T) T convert() { assert(_saveHash); - auto p = `converted/` ~ _saveHash; - try - { - return PEfs.read!T(p); - } - catch (Exception ex) - { - logger.warning(ex.msg); - } + auto p = `converted/` ~ _saveHash; + auto data = PEfs.get(p); + + if (data) + try + { + return data.deserializeMem!T; + } + catch (Exception ex) + { + logger.warning(ex.msg); + } auto res = process; ROfs.put(p, res.serializeMem); diff --git a/source/ro/map/package.d b/source/ro/map/package.d index 36eaff3..dba6831 100644 --- a/source/ro/map/package.d +++ b/source/ro/map/package.d @@ -1,5 +1,4 @@ module ro.map; - import perfontain; public import ro.map.gat, ro.map.rsm, ro.map.gnd, ro.map.rsw; @@ -9,11 +8,10 @@ struct RomFile static immutable { char[3] bom = `ROM`; - ubyte ver = 18; + ubyte ver = 19; } float fogFar, fogNear; - Vector3 fogColor, ambient, diffuse, lightDir; RomWater water; @@ -23,9 +21,7 @@ struct RomFile @(ArrayLength!ushort) RomNode[] nodes; @(ArrayLength!ushort) RomPose[] poses; @(ArrayLength!ushort) RomEffect[] effects; - @(ArrayLength!ushort) RomLight[] lights; - @(ArrayLength!uint) ushort[] lightIndices; HolderData objectsData, waterData; } @@ -49,8 +45,6 @@ struct RomGround struct RomFloor { BBox box; - - uint lightStart, lightEnd; } struct RomCell @@ -72,16 +66,12 @@ struct RomPose { Matrix4 pos; BBox box; - - uint lightStart, lightEnd; - ushort id; } struct RomLight { Vector3 pos, color; - float range; } diff --git a/source/rocl/game.d b/source/rocl/game.d index b892b7a..f236c87 100644 --- a/source/rocl/game.d +++ b/source/rocl/game.d @@ -150,6 +150,7 @@ private: PE.gui.drawGUI = &gui.draw; PE.hotkeys.add(Hotkey(null, { gui.showSettings ^= true; return true; }, SDLK_ESCAPE)); + return true; } diff --git a/source/rocl/loaders/map.d b/source/rocl/loaders/map.d index 9545f3a..8e70f88 100644 --- a/source/rocl/loaders/map.d +++ b/source/rocl/loaders/map.d @@ -1,7 +1,6 @@ module rocl.loaders.map; - -import std.stdio, std.range, std.array, std.algorithm, perfontain, - perfontain.opengl, ro.map, ro.conv, rocl.paths, ro.conv.map, rocl.render.water; +import std.stdio, std.range, std.array, std.algorithm, perfontain, perfontain.opengl, ro.map, ro.conv, rocl.paths, + ro.conv.map, rocl.render.water; struct RomLoader { @@ -28,8 +27,6 @@ private: sc.diffuse = _rom.diffuse; sc.lightDir = _rom.lightDir; - sc.lightIndices = _rom.lightIndices; - sc.lights = _rom.lights.map!(a => LightSource(a.pos, a.color, a.range)).array; sc.fogFar = _rom.fogFar; @@ -49,9 +46,6 @@ private: n.mh = _mh; n.bbox = f.box; - n.lightStart = f.lightStart; - n.lightEnd = f.lightEnd; - node.childs ~= n; } @@ -86,9 +80,6 @@ private: n.oris = s.oris; n.matrix = s.matrix * r.pos; - n.lightStart = r.lightStart; - n.lightEnd = r.lightEnd; - n.bbox = r.box; n.childs = s.childs; diff --git a/source/rocl/resources.d b/source/rocl/resources.d index 0fd6da5..40fb7ac 100644 --- a/source/rocl/resources.d +++ b/source/rocl/resources.d @@ -1,5 +1,4 @@ module rocl.resources; - import std.file, std.format, std.algorithm, perfontain, ro.map, ro.conv, ro.conf, ro.conv.gui, rocl.game, rocl.paths, rocl.loaders.map, rocl.loaders.asp;