All users will need to merge their Minecraft Forum account with a new or existing Twitch account starting October 23rd. You can merge your accounts by clicking here. Have questions? Learn more here.
Dismiss
  • 0

    posted a message on Type1 Anarchy: Mechs Guns Missiles Laizorz -Alpha Download-



    How's that going so far?



    Taking much longer than I thought. I've recently redone the gameplay style to be programatically easier. Also ported about a year of work from Java to C++. Java ended up not working because of its lack of copy and move semantics, which ruined my collision detection perf.


    Heres a screenshot from the old engine, the new version won't have planets until post 1.0 however.


    So without planets it really doesn't resemble T1A that much anymore.
    Closest thing I'd compare it to is Starmade, but I'm taking a much different approach to ship modules, and I've invented a mechanic that solves the issue of exponential growth in a sandbox without arbitrary numerical manipulation, that will also give an entirely unique feel to it.

    I've been working full time on it and am starting to run low on money, but I think I'll have something sellable before I run out.
    I'm terrible at time estimates, but I've put about 16 months of work into this, and theres no way I'm stopping.

    Posted in: WIP Mods
  • 0

    posted a message on Graphics Programming Freelancing
    Id like to do some effects for some mods.

    If your mod is >=1.0 or popular then I will work for free.
    However If your mod isnt complete and you want something complex I will need payed.

    Stuff Ive done for mc







    Flickr
    Posted in: Mods Discussion
  • 0

    posted a message on Type1 Anarchy: Mechs Guns Missiles Laizorz -Alpha Download-
    Honestly you would probably be better off working with Flan's if you want to see progress.

    The only big thing that T1A has that are worth salvaging are

    -The the module system for mechs, but its mostly just abstraction.

    -The gun system. The way that parts and ammo work is way more complex than any other mod. I tried to get Flan to take some of it but he didnt want it.
    Posted in: WIP Mods
  • 0

    posted a message on [Tutorial] Using Shaders with Entity Renderers
    Updated OP.

    Bench- With particle position transformation done on cpu, my computer can do 100k cubes at 30fps.

    Although I just realized that instanced rendering would be even faster than a geometry shader, although cpu is the limiter.
    Posted in: Modification Development
  • 0

    posted a message on [Tutorial] Using Shaders with Entity Renderers
    This is not an OpenGL tutorial, but the example code here will make it very easy for anyone who knows modern GL to use it with any renderer

    matrix ripper
    private static FloatBuffer matbuf= BufferUtils.createFloatBuffer(16);
     /**Must be called when the matrix is in the appropriate state, generally does not work with UI rendering*/
     public static void useLegacyMVP(int uniformLocation){
     Matrix4f mv= new Matrix4f();
     GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, matbuf);
     mv.load(matbuf);
     matbuf.clear();
     
     Matrix4f p= new Matrix4f();
     GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, matbuf);
     p.load(matbuf);
     matbuf.clear();
     
     Matrix4f mvp= new Matrix4f();
     Matrix4f.mul(p, mv, mvp);
     mvp.store(matbuf);
     matbuf.clear();
     GL20.glUniformMatrix4(uniformLocation, false, matbuf);
    } 
    Takes the modelview projection matrix from legacy and loads it into the uniform.


    Example using a geometry shader to make cubes out of points
    /**Author: Khlorghaal
     * Public Domain, attribution preferred*/
    public class CubeRenderer {
     static int program;
     static int attlocpos, ulocmvp, uloccolor, ulocscale;//binding points
     
     //using literals, sue me
     static String vshsrc= 
     "#version 150 core\n"//don't forget \n with preprocessor
     + "uniform mat4 mvp;"
     + ""
     + "in vec3 posin;"
     + "out vec3 posg;"
     + "out float sizeg;"
     + "void main(){"
     + "posg= posin;"
     + "}";
     static String gshsrc= 
     "#version 150 core\n"
     + "vec3 corners[8]= vec3[]( "
     + "vec3( 1, 1, 1),"//+++
     + "vec3( 1, 1,-1),"//++-
     + "vec3( 1,-1, 1),"//+-+
     + "vec3( 1,-1,-1),"//+--
     + "vec3(-1, 1, 1),"//-++
     + "vec3(-1, 1,-1),"//-+-
     + "vec3(-1,-1, 1),"//--+
     + "vec3(-1,-1,-1) "//---
     + ");"
     + "int cornerIndicies[6*4]= int[]("
     + "0,2,1,3,"//x- from the matching sign of axis-columns of ^
     + "4,5,6,7,"//x+ some rows rearranged for correct culling order, via xzyw swizzle
     + "2,6,3,7,"//y- 
     + "0,1,4,5,"//y+ This is one of my favorite examples of beautiful code
     + "1,3,5,7,"//z- 
     + "0,4,2,6"//z+
     + ");"
     + ""
     + "uniform mat4 mvp;"
     + "uniform float scale;"
     + ""
     + "layout(points) in;"
     + "in vec3 posg[];"
     + ""
     + "layout(triangle_strip, max_vertices= 24) out;"
     + "void main(){"
     + "vec3 pos= vec3(posg[0]);"
     + "for(int i=0; i!=6; i++){"//faces
     + "for(int j=0; j!=4; j++){"//corners
     + "gl_Position= mvp*vec4(pos+corners[cornerIndicies[i*4+j]]*scale, 1);"
     + "EmitVertex();"
     + "}"
     + "EndPrimitive();"
     + "}"
     + ""
     + "}";
     static String fshsrc= 
     "#version 150 core\n"
     + "uniform vec4 color;"
     + ""
     + "out vec4 colorout;"
     + "void main(){"
     + "colorout= color;"
     + "}";
     
     static{
     program= GL20.glCreateProgram();
     int vsh= GL20.glCreateShader(GL20.GL_VERTEX_SHADER);
     int gsh= GL20.glCreateShader(GL32.GL_GEOMETRY_SHADER);
     int fsh= GL20.glCreateShader(GL20.GL_FRAGMENT_SHADER);
     GL20.glShaderSource(vsh, vshsrc);
     GL20.glShaderSource(gsh, gshsrc);
     GL20.glShaderSource(fsh, fshsrc);
     GL20.glCompileShader(vsh);
     GL20.glCompileShader(gsh);
     GL20.glCompileShader(fsh);
     String verr= GL20.glGetShaderInfoLog(vsh, 512); if(!verr.equals(""))System.err.println("_____\nVSH ERROR\n"+verr);
     String gerr= GL20.glGetShaderInfoLog(gsh, 512); if(!gerr.equals(""))System.err.println("_____\nGSH ERROR\n"+gerr);
     String ferr= GL20.glGetShaderInfoLog(fsh, 512); if(!ferr.equals(""))System.err.println("_____\nFSH ERROR\n"+ferr);
     GL20.glAttachShader(program, vsh);
     GL20.glAttachShader(program, gsh);
     GL20.glAttachShader(program, fsh);
     GL20.glLinkProgram(program);
     String perr= GL20.glGetProgramInfoLog(program, 512); if(!perr.equals(""))System.err.println(perr);
    
    attlocpos= GL20.glGetAttribLocation(program, "posin");
     ulocmvp= GL20.glGetUniformLocation(program, "mvp");
     ulocscale= GL20.glGetUniformLocation(program, "scale");
     uloccolor= GL20.glGetUniformLocation(program, "color");
     
     }
     
     static ByteBuffer buf= BufferUtils.createByteBuffer(512*4);
     
     int vbo, vao;
     int maxcubes;
     /**Must only be constructed from render thread*/
     public CubeRenderer(int maxcubes){
     this.maxcubes= maxcubes;
     
     vbo= GL15.glGenBuffers();
     GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vbo);
     GL15.glBufferData(GL15.GL_ARRAY_BUFFER, buf, GL15.GL_DYNAMIC_DRAW);
     
     vao= GL30.glGenVertexArrays();
     GL30.glBindVertexArray(vao);
     //vbo already bound
     GL20.glEnableVertexAttribArray(attlocpos);
     GL20.glVertexAttribPointer(attlocpos, 3, GL11.GL_FLOAT, false, 3*4, 0);
     GL30.glBindVertexArray(0);//must unbind
     GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);
     System.err.println(GLU.gluErrorString(GL11.glGetError()));
     }
     
     @SubscribeEvent
     public void render(RenderWorldLastEvent e){
     GL11.glPushAttrib(GL11.GL_BLEND);
     GL11.glEnable(GL11.GL_BLEND);
     GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
     
     GL20.glUseProgram(program);
    // GL30.glBindVertexArray(vao);
    // GL11.glDrawArrays(GL11.GL_POINTS, 0, maxcubes);
     useLegacyMVP(ulocmvp);
     GL20.glUniform4f(uloccolor, 0, 0, 1, 15f);
     GL20.glUniform1f(ulocscale, .2f);
     GL11.glPointSize(300);
     GL11.glBegin(GL11.GL_POINTS);//IMMEDIATE MOOODEEEE DESPAAIIRRRRRRRRRR
     GL11.glVertex3f(0, 2, 0f);
     GL11.glVertex3f(1, 0, 0f);
     GL11.glVertex3f(0, 0, 1f);
     GL11.glVertex3f(-1, 0, 0f);
     GL11.glVertex3f(0, 0, -1f);
     GL11.glEnd();
     GL20.glUseProgram(0);
     
     GL11.glPopAttrib();
     }
     
     private static FloatBuffer matbuf= BufferUtils.createFloatBuffer(16);
     /**Must be called when the matrix is in the appropriate state, generally does not work with UI rendering*/
     public static void useLegacyMVP(int uniformLocation){
     Matrix4f mv= new Matrix4f();
     GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, matbuf);
     mv.load(matbuf);
     matbuf.clear();
     
     Matrix4f p= new Matrix4f();
     GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, matbuf);
     p.load(matbuf);
     matbuf.clear();
     
     Matrix4f mvp= new Matrix4f();
     Matrix4f.mul(p, mv, mvp);
     mvp.store(matbuf);
     matbuf.clear();
     GL20.glUniformMatrix4(uniformLocation, false, matbuf);
     
     getLightColor();
     }
     
     public static float[] getLightColor(){
     float r=0;
     float g=0;
     float b=0;
     return new float[]{r,g,b};
     }
     
     
    }




    TODO use access transformers to read from the lightmap to pass to a uniform
    Posted in: Modification Development
  • 0

    posted a message on Anti-aliasing In Minecraft for Nvidia users
    Quote from mattbar
    "fboEnable:true" TO "fboEnable:false" FOR ANTI-ALISING TO WORK.

    Um what? Rendering to a framebuffer will prevent any driver aa from working.
    edit: derp read that backwards
    yea that would definitely fix it lol
    Posted in: Tutorials and FAQs
  • 0

    posted a message on Anti-aliasing In Minecraft for Nvidia users
    http://www.neogaf.com/forum/showthread.php?t=509076
    BEHOLD THE GRAIL
    Though do be careful cuz this can break things >.>

    Unforunately this only works with very beefy computers, I can only get it working at 1.5*resolution = 2.25 samples per pixel, and thats with a very nice setup. The flaw is it needs your monitor to be capable of handling the resolution eventhough your monitor isnt whats doing the downsampling.
    2.25x is pretty shoddy, but it still helps with the jaggies.


    I've concluded just forcing FXAA ultimately does a better job than all these crazy hacks
    Posted in: Tutorials and FAQs
  • 0

    posted a message on Type1 Anarchy: Mechs Guns Missiles Laizorz -Alpha Download-
    The engine isn't related to t1a's code. Its the same inspirations though.
    I'm making it in a way that it won't be just another terraria clone either. It will give players a very high degree of customization, like you're able to create new blocks including their appearance, then people joining your server will be able to download them automatically. I don't want to reveal too much this early, but I have very high hopes for it.



    facebook
    youtube
    Posted in: WIP Mods
  • 0

    posted a message on Type1 Anarchy: Mechs Guns Missiles Laizorz -Alpha Download-
    Quote from biohazarddare

    well Controls, subsystem, and equipment inventory

    https://github.com/khlorghaal/t1a/tree/master/typ1a/common/Equipment
    contains the bulk of it. Its not organized as well as it should be and lacks a macrodoc.

    The big class is EquipmentFacade which ties subsystems and inventory together, aggregate an instance of it onto any Entity implementing IEquipmentAcceptor.
    EntityTechVehicle is meant to be extended to make stuff like mechs and planes.
    EquipmentSystem should be extended to make a type of equipment which functions as a group, like shields

    Sadly I left most of it in a broken state, but theres still the useful design patterns there



    Message me on skype if you have questions
    Posted in: WIP Mods
  • 0

    posted a message on Type1 Anarchy: Mechs Guns Missiles Laizorz -Alpha Download-
    Quote from biohazarddare

    Is there any chance i can get the mech code?

    Which part?
    Controls
    Subsystems
    Equipment inventory
    Weapons


    hit me on skype:khlorghaal
    Posted in: WIP Mods
  • 0

    posted a message on GPGPU for ~100x faster Chunk Rendering
    Quote from Cuchaz

    From what I can tell, the world renderer uses OGL call lists which are cached across multiple frames. It seems to me that optimizing conversion of world geometry into call lists would only give a small speedup during loading, and no noticeable impact on average FPS.

    Unlike pretty much everything else in mc, chunks are actually stored as VBOs. They have to be otherwise the game would be unplayable.

    And yeah there would be no effect once chunks are loaded, its for loading speed not rendering. Wording is getting ambiguous here because if i say loading then people think loading the block data, while if i say rendering people think rendering every frame, while if i say vbo generation people have no idea what im talking about :/
    Posted in: Suggestions
  • 0

    posted a message on GPGPU chunk rendering ~100x faster!
    Quote from immibis
    rewriting part of every mod in a different language
    not that much benefit

    Stuff like generating trees and mod generation could be done as a postprocess. This would be advantageous for the generation of the basic stone still. But you're right about the benefit being negligible then, because if its just a few ops per cube then it might actually be slower because the cpu has to read/write the data to send it to gpu anyways, then driver overhead
    Posted in: Requests / Ideas For Mods
  • 0

    posted a message on Minecraft Multithread / Multicore CPU Support (Will Lead to Huge FPS Boosts)
    Quote from MacUser123456789
    an obvious suggestion... rewrite Minecraft in C.
    Java is barely slower than C++ once the JIT goes over everything

    The main bottleneck with minecraft is just an accumulation of very poorly written methods, theres nothing singularly bad, but theres tons of small things that are done poorly. Lots of things aren't object oriented.
    Posted in: Suggestions
  • 0

    posted a message on GPGPU for ~100x faster Chunk Rendering
    The majority of time spent loading a chunk is looking at each block to tell if it is visible, the processor has to look at all 4000 blocks individually, while the GPU can do it in parallel.

    My 8-core CPU is 32 GigaFLOPS while my 980-core GPU is 1000 GigaFLOPS, making it about 30 times faster, but on cpu its normally done in a single thread, not 8, which would make gpu 250 times faster. Theres overhead with moving data to the gpu, so I'm guessing it would be around 100 times faster.

    The end result would be near-instant chunk loading.
    Also this glitch

    would no longer happen, as thats a bug with render manager deciding which chunks to load first, while if they all load near-instantly there is no longer a need to sort them
    Posted in: Suggestions
  • 0

    posted a message on GPGPU for ~100x faster Chunk Rendering
    Idea as a mod, separate thread
    So I just realized how easy it would be to gpgpu for chunk vbo generation and possibly even generating the blocks.
    Bind transform feedback
    Bind chunk id[] as an isamplerBuffer
    Render 16^3 points with no attribs
    Use gsh to out pos, uv.
    In gsh detect blocks surrounded by 6 opaque blocks, cull them by not emitting

    Considering theres 16^3~=4k blocks in a chunk, im guessing this would be at least 100x as fast. Since when using an ssd on a pregenerated world loading is still an issue: I believe creating the vbo is the main bottleneck for speed. So this would be an absolutely immense performance boost for anyone with GL>3.1 (pretty much everyone)


    This would be best if mojang implemented it directly though.
    If someone doesnt have GL3.2 then it can be easily autodetected then they just use the same old chunk rendering.
    This thread under Minecraft Suggestions because I don't see why anyone wouldn't want this in vanilla.
    Posted in: Suggestions
  • To post a comment, please or register a new account.