honestly that looks pretty annoying
why not just use a horizontal bar at the top or whatever like browsers usually do
I haven't posted here a lot, but I've made a lot of improvements to my rendering framework.
On the 'visible' end I've most noticeably added renderbuffers, allowing for screen space image effects such as:
[t]https://i.imgur.com/mjFGu62.jpg[/t]
and
[t]https://i.imgur.com/joBuziU.png[/t]
On the back-end I've built a stateless rendering loop by way of RenderKey sorting. It's quite nice :v: The most important thing so far is that I've always kept good syntax in mind. I have the philosophy that I'm not going to have the user manage anything that the framework can't manage for him. So my framework is very low-friction to learn and use properly.
This is all for working towards my biggest step, which I hope to show soon, hemisphere lighting!
[vid]https://files.facepunch.com/ziks/2016/March/08/2016-03-08-1404-47.mp4[/vid]
Level editor's done for now.
[QUOTE=Trebgarta;49891582]IMO it is not THAT annoying but browsers stuff us pretty accustomed to so thatd be a solid choice[/QUOTE]
The problem also is, I dont want the user to interact with the webview before I have injected my custom CSS/JS, as that could result in unexpected stuff.
[t]http://i.imgur.com/oKmaK8B.jpg[/t]
Bada bing bada boom, submeshes
Monday warrior.
[IMG]http://i.imgur.com/TOEtrDj.png[/IMG]
I wish I was done with uni so I could work on this full time.
The problem is that I'm working an awesome job part time but it would be silly to drop out my junior year.
Not to mention the project is basically top secret so I can't show you guys the progress. That kills me. WAYWO was a huge motivator for me when I was starting out.
[QUOTE=Verideth;49887656]How do you get such awesome stuff done in such short time?[/QUOTE]
Ziks has quite a lot of domain specific experience (building level editors and VR stuff), he just remembers how to do something once he has figured it out well before in a previous project.
[editline]8th March 2016[/editline]
Really, there's no secret to it, you just have to program more and more, and don't forget to finish/polish it.
[QUOTE=ichiman94;49894202]Ziks has quite a lot of domain specific experience (building level editors and VR stuff), he just remembers how to do something once he has figured it out well before in a previous project.[/QUOTE]
Actually I haven't made an editor like this before, but Layla made an awesome one a little while ago that I learnt a lot from.
Just admit that you are not one person, Ziks! We know it!
[b]Or you are just a terminator[/b]
Right, why haven't I played with geometry shaders before, this is more fun than I thought it would be.
[img]http://i.imgur.com/YwRiJEp.png[/img]
And that's just an array of 100 GL_POINTS with an incrementing angle uniform.
Now to start doing something useful with them...
[code]
const char* shaders[] = {
// Vertex
"uniform float angle;\n"
"out float angles;\n"
"void main() {\n"
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
" angles = angle;\n"
"}",
// Geometry
"#version 150\n"
"in float angles[];\n"
"uniform vec2 size;\n"
"layout (points) in;\n"
"layout (triangle_strip, max_vertices = 4) out;\n"
"out vec2 tex_coord;\n"
"out vec4 color;\n"
"void main() {\n"
" vec2 half_size = size / 2.f;\n"
" for (int i = 0; i < gl_in.length(); i++) {\n"
" vec2 ang_x = vec2(cos(angles[i]), sin(angles[i]));\n"
" vec2 ang_y = vec2(cos(angles[i] + 1.5707f), sin(angles[i] + 1.5707f));\n"
" vec2 pos = gl_in[i].gl_Position.xy;\n"
" gl_Position = vec4(pos - (ang_x * half_size + ang_y * half_size), 0.f, 1.f);\n"
" color = vec4(1.f, 0.f, 0.f, 1.f);\n"
" tex_coord = vec2(1.f, 1.f);\n"
" EmitVertex();\n"
" gl_Position = vec4(pos - (ang_y * half_size - ang_x * half_size), 0.f, 1.f);\n"
" color = vec4(0.f, 1.f, 0.f, 1.f);\n"
" tex_coord = vec2(0.f, 1.f);\n"
" EmitVertex();\n"
" gl_Position = vec4(pos - (ang_x * half_size - ang_y * half_size), 0.f, 1.f);\n"
" color = vec4(0.f, 0.f, 1.f, 1.f);\n"
" tex_coord = vec2(1.f, 0.f);\n"
" EmitVertex();\n"
" gl_Position = vec4(pos + (ang_x * half_size + ang_y * half_size), 0.f, 1.f);\n"
" color = vec4(1.f, 1.f, 1.f, 1.f);\n"
" tex_coord = vec2(0.f, 0.f);\n"
" EmitVertex();\n"
" EndPrimitive();\n"
" }\n"
"}",
// Fragment
"#version 150\n"
"//uniform sampler2D texture;\n"
"in vec2 tex_coord;\n"
"in vec4 color;\n"
"void main() {\n"
" gl_FragColor = color;\n"
"}"
};
[/code]
[QUOTE=Asgard;49893091][t]http://i.imgur.com/oKmaK8B.jpg[/t]
Bada bing bada boom, submeshes[/QUOTE]
Is that fairly naive GL/DX? What kind of performance do you get for that? (curious to compare against my own)
[editline]8th March 2016[/editline]
[QUOTE=Asgard;49893091][t]http://i.imgur.com/oKmaK8B.jpg[/t]
Bada bing bada boom, submeshes[/QUOTE]
Is that fairly naive GL/DX? What kind of performance do you get for that? (curious to compare against my own)
[QUOTE=Icedshot;49894553]
Is that fairly naive GL/DX? What kind of performance do you get for that? (curious to compare against my own)[/QUOTE]
Naive? Not really, as it's "stateless" in the back-end a.k.a sorted draw calls. according to gDEBugger I have no redundant calls. Performance I'll have to measure but I'll gladly get back to you on that. :v:
[QUOTE=Asgard;49893091][t]http://i.imgur.com/oKmaK8B.jpg[/t]
Bada bing bada boom, submeshes[/QUOTE]
Is that fairly naive GL/DX? What kind of performance do you get for that? (curious to compare against my own)
Edit:
I'm just really curious guys ok, don't judge
Also in not too long I'll get it all back on the GitHub and you can check out the source if you'd like
[editline]8th March 2016[/editline]
Man, Facepunch is acting up
I've long wanted a script language with a proper IDE, but then I've had the idea of having a native language as sort of a scripting language too. This week I started working on something that turned out pretty neat.
But you might say the point of a scripting language is so you don't have to recompile and restart. That is true. Granted you use simple C/C++ code files should compile very quickly, and I've added support for compiling and reloading scripts all within the library.
(Error checking is not shown in these snippets)
If you have these application functions:
[code]
namespace
{
namespace Functions
{
/*
Trivial types can automatically have their types deduced.
*/
int App_Test1(const char* literal, int& numberref)
{
numberref = 20;
std::cout << literal << " " << numberref << std::endl;
return 30;
}
/*
Non trivial types automatically get replaced with UserClassType unless
a manual signature is created.
*/
void App_Test2(std::string&& string)
{
std::cout << string << std::endl;
}
/*
Manual signatures can include the paramter name too.
*/
void App_Test3(const std::string& string)
{
std::cout << string << std::endl;
}
}
}
[/code]
You can register them for scripts to use like this:
[code]
namespace NA = NativeScript::App;
namespace NShared = NativeScript::Shared;
auto scriptstate = NA::CreateState();
std::vector<NShared::NativeFunction> appfunctions =
{
NShared::CreateFunction("App_Test1", Functions::App_Test1),
NShared::CreateFunction("App_Test2", Functions::App_Test2),
NShared::CreateFunction("App_Test3", Functions::App_Test3, NSCRIPT_SIG(const std::string& string)),
};
for (auto& func : appfunctions)
{
NA::RegisterAppFunction(scriptstate, &func);
}
[/code]
Signature strings for functions can automatically be figured out using variadic template magic, it doesn't include the parameter names however unless you manually add them.
Compiling a script is as easy as (don't mind the paths):
[code]
NativeScript::Shared::Status CompileExampleScript(NativeScript::Shared::ScriptState* scriptstate)
{
namespace NA = NativeScript::App;
namespace NShared = NativeScript::Shared;
NA::SetCompilerPath(scriptstate, L"C:\\Program Files (x86)\\MSBuild\\14.0\\Bin\\MSBuild.exe");
NShared::ScriptCompileData compiledata = {nullptr};
compiledata.SolutionPath = L"C:\\Github\\NativeScript\\Source\\NativeScript.sln";
compiledata.ProjectName = L"ExampleScript";
NShared::ScriptCompileStatsData compilestats;
return NA::CompileScript(scriptstate, &compiledata, &compilestats);
}
[/code]
And then loading and using it:
[code]
NShared::ScriptHandle* scripthandle;
NA::LoadScriptFromFile(scriptstate, L"ExampleScript.dll", &scripthandle);
auto scriptstartup = NA::GetScriptFunction(scripthandle, "Script_Startup");
auto scriptupdate = NA::GetScriptFunction(scripthandle, "Script_Update");
auto scriptshutdown = NA::GetScriptFunction(scripthandle, "Script_Shutdown");
if (scriptstartup)
{
NShared::CallFunction(scriptstartup);
}
for (size_t i = 0; i < 10; i++)
{
if (scriptupdate)
{
NShared::CallFunction(scriptupdate);
}
}
if (scriptshutdown)
{
NShared::CallFunction(scriptshutdown);
}
[/code]
Functions can have any count of parameters and any type of return value. They just need to be the same on both sides as they are called directly without any extra layers to keep performance.
The full example script looks like this:
[code]
#include "Native Script\NativeScript.hpp"
#include <vector>
namespace NS = NativeScript::Script;
namespace NShared = NativeScript::Shared;
namespace
{
NShared::ScriptHandle* ThisHandle;
namespace Functions
{
void Script_Startup()
{
static auto appfunc1 = NS::GetAppFunction(ThisHandle, "App_Test1");
if (appfunc1)
{
int number = 10;
int returnvalue;
NShared::CallFunction(&returnvalue, appfunc1, "Literal", number);
}
}
void Script_Update()
{
static auto appfunc2 = NS::GetAppFunction(ThisHandle, "App_Test2");
if (appfunc2)
{
NShared::CallFunction(appfunc2, "String"s);
}
}
void Script_Shutdown()
{
static auto appfunc3 = NS::GetAppFunction(ThisHandle, "App_Test3");
if (appfunc3)
{
NShared::CallFunction(appfunc3, "Hello"s);
}
}
}
std::vector<NShared::NativeFunction> ScriptFunctions =
{
NShared::CreateFunction("Script_Startup", Functions::Script_Startup),
NShared::CreateFunction("Script_Update", Functions::Script_Update),
NShared::CreateFunction("Script_Shutdown", Functions::Script_Shutdown),
};
}
extern "C" __declspec(dllexport) void ScriptOutput_Initialize(NShared::ScriptInitializeData* indata)
{
ThisHandle = indata->UserHandle;
for (auto& func : ScriptFunctions)
{
NS::RegisterScriptFunction(ThisHandle, &func);
}
}
extern "C" __declspec(dllexport) NShared::ScriptQueryData ScriptOutput_Query()
{
NShared::ScriptQueryData ret;
ret.Version = 1;
ret.AuthorName = "CRASH FORT";
ret.ScriptName = "Example script";
ret.ScriptDescription = "Example script as starting template";
ret.AuthorContact = "Unknown";
return ret;
}
[/code]
This should work in any VS version / compiler for Windows as long as it supports variadic templates and constexpr and some other of those features since the template stuff is in the header only.
Also why does the edit box go empty when I try to edit this?
[QUOTE=CRASHFORT;49894795]Also why does the edit box go empty when I try to edit this?[/QUOTE]
Long standing bug caused by certain characters in the post if I'm not mistaken. I thought it had been fixed though...
[QUOTE=Asgard;49893091][t]http://i.imgur.com/oKmaK8B.jpg[/t]
Bada bing bada boom, submeshes[/QUOTE]
Is that fairly naive GL/DX? What kind of performance do you get for that? (curious to compare against my own)
[QUOTE=BackwardSpy;49895147]Is that fairly naive GL/DX? What kind of performance do you get for that? (curious to compare against my own)[/QUOTE]
I'd bet you'd like to know that don't you
Sorry this is a bit long winded but I got a bit carried away with how much fun I had. It reminds me of my old Freelancer modding days. It's not the most programmy related thing, but I had fun with it.
I’ve had some old models exported from Freelancer from years ago, but because they were specifically for animation and formatted to work nicely with Lightwave 3D. I’ve never been happy with just re-using those for fun experiments in Unity because they were awkward to work with and I only had a handful of them.
So tonight I looked back into exporting CMPs from Freelancer, as well as their materials. I used Milkshape 1.7.6, which is working with the exporter a lot better than the version I used years ago. The models were exported first into OBJ format.
The important thing about exporting to OBJ is that I keep the material colors along with the material names. This is [I]very[/I] important because almost all materials in Freelancer have a modifier color. This is where things such as the colored insignia come from, and in the past it was something I had to take care to do manually for each colored material. After some mostly automated processing in 3DS Max to re-create smoothing groups and weld polys together, I export them in FBX format into Unity.
In Unity, they keep the material color references as long as you set it to use the model’s material rather than creating new materials based on the texture. The other benefit to this, is that it’ll re-use all the appropriate materials, just like Freelancer did. Freelancer shared [B]a lot[/B] of materials between its models as a space saving measure, and using this new method I’m able to take advantage of that.
The end result is that I was able to streamline my whole ship exporting process down to minutes if it was a ship with ready to go textures. If it was the first ship in a line (first pirate ship for example) then it takes me some time to export all the textures, but once those are in place, I can go from CMP to in engine in Unity in a matter of [I]minutes[/I] depending on the ship’s complexity.
It’s pretty amazing considering how long it used to take me to export these models.
One more thing that I’ve kept intact this time is separation of ship subobjects. With this, I can create much more accurate collision meshes (that incidentally will match very closely with the accurate vanilla Freelancer SUR files). It also opens the door to things such as animations.
[t]https://41.media.tumblr.com/a4694fbae667997ea1e8a9e7715ded5d/tumblr_o3rb5khAYF1r9waklo1_1280.png[/t]
Super Not So Hot. I tried to mod my first game (that does not nativly support modding or having a modding API like garrys mod or minecraft). The game enables more colors (Other than just red). I also wrote some no recoil, rapid fire, no ammo and teleport stuff. Not that I will use it as the game is fun but just because it was crazy fun to make.
[video=youtube;UBvmHgbBZ5c]http://www.youtube.com/watch?v=UBvmHgbBZ5c[/video]
[IMG]http://51.254.129.74/~anon/files/1457516729.png[/IMG]
I wrote a simple telnet server in C# and implemented a chat in it. Try it out!
[URL="http://vps229649.ovh.net/~anon/ip.txt"]93.136.48.177[/URL] port 6666
[editline]9th March 2016[/editline]
Does anybody know a telnet client which runs in-browser (as a web page with js or whatever) so i can host a more permanent chat that doesn't require a client?
[QUOTE=cartman300;49897699][IMG]http://51.254.129.74/~anon/files/1457516729.png[/IMG]
I wrote a simple telnet server in C# and implemented a chat in it. Try it out!
[URL="http://vps229649.ovh.net/~anon/ip.txt"]93.136.48.177[/URL] port 6666
[editline]9th March 2016[/editline]
Does anybody know a telnet client which runs in-browser (as a web page with js or whatever) so i can host a more permanent chat that doesn't require a client?[/QUOTE]
I go out for KFC and come back to this
[t]https://jii.moe/VymdAktng.png[/t]
:v:
Here's a longer video of using the VR level editor:
[media]https://www.youtube.com/watch?v=4Cro1HdCoP0[/media]
Excuse the shitcode in some places.
[url]https://github.com/cartman300/Chatnet[/url]
I am learning Behavior Trees, what the fuck I have never been so confused in my life
So regarding the graphics glitch from before. I've ran the program on another PC and it doesn't show up there...
There's some strange fuckery going on. I think I'll drop down to raw OpenGL and just replace my rendering backend.
Having fun with GLEW+GLFW and trying out threading.
[IMG]http://i.imgur.com/BN5m8dd.gif[/IMG]
The main thread runs the console input. Saving any input to a vector used by an other thread (that runs everything else) to process the commands when possible.
Added some portraits. Also changed up the layout a bit. :v: I'm pretty pleased how the images looks like if you pixelate them enough
[vid]https://gfycat.com/ScrawnyKaleidoscopicEeve[/vid]
[url]https://gfycat.com/ScrawnyKaleidoscopicEeve[/url]
Sorry, you need to Log In to post a reply to this thread.