I finally got my thing to render on nVidia cards, and i finally figured out what was the problem after very very much testing, basically i just mistyped a variable type in fragment shader for the screen quad from vec4 to vec3 and it renders just fine on ATI cards because it seems it defaults to 1 there while it defaults to 0 on nVidia cards making it transparent.
[QUOTE=awcmon;45731392]i hate to be the immature one but
[img]https://dl.dropboxusercontent.com/u/13397008/8-18-2014%203-53-51%20PM.png[/img]
I felt that this was a peculiar looking asteroid[/QUOTE]
It looks like diarrhea in zero gravity.
[QUOTE=awcmon;45731392]i hate to be the immature one but
[img]https://dl.dropboxusercontent.com/u/13397008/8-18-2014%203-53-51%20PM.png[/img]
I felt that this was a peculiar looking asteroid[/QUOTE]
Man that [I]is[/I] a strange-looking hotdog.
[media]http://www.youtube.com/watch?v=xeP5rG2H5UM[/media]
playing with shadow maps :D (and Voxels)
[QUOTE=Lumaio;45733439]I'm curious, do you guys do your OpenGL stuff in pure code? Or do you use some sort of framework?
[/QUOTE]
C++, GLEW, GLFW, and QT
Edit:
Any suggestions how to handle objects that belong in 2 or more nodes of an octree ? store them in each of them ? or only in the parent node ? or something else ? divide it (not a good option i guess...)?
I'm working on a game engine, here's a random character generator:
[media]http://www.youtube.com/watch?v=26Y8pCJqtK8[/media]
[QUOTE=Mr Kirill;45737283]I'm working on a game engine, here's a random character generator:
[media]http://www.youtube.com/watch?v=26Y8pCJqtK8[/media][/QUOTE]
[I]"Well, you can tell by the way I use my walk I'm a woman's man: no time to talk"[/I]
Trying to convert game's alien color format
[code] public static Color GetColorFrom16bit(UInt16 n)
{
//4:4:3:5
byte R = (byte)((n >> 12) << 4);
byte G = (byte)(((n << 4) >> 8) << 4);
byte B = (byte)(((n << 8) >> 5) << 5);
byte A = (byte)((n << 11) >> 8);
Color color = Color.FromArgb(A, R, G, B);
return color;
}[/code]
[code] public static UInt16 Get16bitFromColor(Color c)
{
return (UInt16)(((c.R >> 4) << 12) | ((c.G >> 4) << 8) | ((c.B >> 5) << 5) | (c.A >> 3));
}[/code]
For some reason Get16bitFromColor produces slightly off Reds. I have no idea :suicide:
I've only recently started using bitwise operations. So that might be it.
Reading straight from the game's files:
[img]http://i.imgur.com/HBEjmwj.png[/img]
Exporting and then importing the same sprite:
[img]http://i.imgur.com/RN8e843.png[/img]
It's slightly darker which completely fucks up the rendering in-game. :suicide:
[QUOTE=Lumaio;45733439]I'm curious, do you guys do your OpenGL stuff in pure code? Or do you use some sort of framework?
[editline]phrasing, man[/editline]
Bad phrasing, sorry, but it seems people know what I'm talking about. Things happen to my speech when I'm up for too long. :suicide:[/QUOTE]
C++ with SFML for window creation/input handling and GLM for some data structures.
[QUOTE=NovembrDobby;45738406]C++ with SFML for window creation/input handling and GLM for some data structures.[/QUOTE]
I'd listen to Dobby, he's a certified master of code.
[code]
require Dash
class Fibonacci
{
defn Integer run(Integer n)
where(n < 2)
{
return n
}
defn Integer run(Integer n)
{
return run(n - 1) + run(n - 2)
}
}
[/code]
This is what dash looks like so far
Fuck staring at one simple line of code you think is perfectly fine but you know it's not. For one fucking hour and counting.
[QUOTE=MatheusMCardoso;45739613]Fuck staring at one simple line of code you think is perfectly fine but you know it's not. For one fucking hour and counting.[/QUOTE]
Break it up into seperate lines then, silly!
[QUOTE=krix;45739657]Break it up into seperate lines then, silly![/QUOTE]
[code]return (UInt16)(((c.R >> 3) << 11) | ((c.G >> 2) << 5) | (c.A >> 3));[/code]
How's it gonna help :suicide:
[QUOTE=MatheusMCardoso;45739737][code]return (UInt16)(((c.R >> 3) << 11) | ((c.G >> 2) << 5) | (c.A >> 3));[/code]
How's it gonna help :suicide:[/QUOTE]
What are those components? It reminds me of unpacking bits in MIPs :v: Shifting x bits right then y left to remove x bits and pad with y zeroes.
[QUOTE=hexpunK;45739787]What are those components? It reminds me of unpacking bits in MIPs :v: Shifting x bits right then y left to remove x bits and pad with y zeroes.[/QUOTE]
It's two color channels and one alpha channel.
5:6:5
I can so far convert these channels into a presentable pixel but if i do the inverse the colors get messed up. That line is trying to do the inverse.
[QUOTE=awcmon;45731392]i hate to be the immature one but
[IMG]https://dl.dropboxusercontent.com/u/13397008/8-18-2014 3-53-51 PM.png[/IMG]
I felt that this was a peculiar looking asteroid[/QUOTE]
it's random i swear
[QUOTE=MatheusMCardoso;45739613]Fuck staring at one simple line of code you think is perfectly fine but you know it's not. For one fucking hour and counting.[/QUOTE]
Reminds me when I created functions in functions in Lua.
[QUOTE=MatheusMCardoso;45739845]It's two color channels and one alpha channel.
5:6:5
I can so far convert these channels into a presentable pixel but if i do the inverse the colors get messed up. That line is trying to do the inverse.[/QUOTE]
Wasn't the conversion for that some non power of two factor? If you just bit shift it's going to turn out too dark in the higher range.
[QUOTE=MatheusMCardoso;45739737][code]return (UInt16)(((c.R >> 3) << 11) | ((c.G >> 2) << 5) | (c.A >> 3));[/code]
How's it gonna help :suicide:[/QUOTE]
DON'T shift right then left or vice-versa :v: use masks.
Your problem, by the way (I think) is that the left-shift by 11 is happening [I]before[/I] the cast to uint16, so you're shifting an 8-bit number and chucking out all of the data.
Personally I'd end up writing it like this
[code]return ((((UInt16)c.R) & 0xf8) << 8) |
((((UInt16)c.G) & 0xfc) << 3) |
(((UInt16)c.A) >> 3);[/code]
So I opened up UnityEngine.dll in ILSpy, and in the Mathf class found this:
[csharp]
public static float Sin(float f)
{
return (float)Math.Sin((double)f);
}
public static float Cos(float f)
{
return (float)Math.Cos((double)f);
}
public static float Tan(float f)
{
return (float)Math.Tan((double)f);
}
[/csharp]
It's just calling the System.Math methods.
I kinda expected there to be internal calls to the native C++ sin family, but that's probably not faster anyway.
Also, for some reason Mathf is a struct instead of a static class.
My Meth class does the same, except it's a class.
My Cocaine class helps me get stuff done very quickly.
[QUOTE=cartman300;45741232]My Meth class does the same, except it's a class.[/QUOTE]
I always thought it was a class [I]A[/I]
Oh hell... what a pageking; here, quick, have a crappy cube thing I made today messing around with OpenGL:
[IMG]http://i.imgur.com/pOQgFn8.gif[/IMG]
[editline]20th August 2014[/editline]
[I]jerky[/I]
Got a grass texture on the terrain, now just to implement a real sky, fog, shadows, physics, sun beams, terrain lod, multitexturing...
[IMG]http://i.imgur.com/5IMllc7l.png[/IMG]
Also, if anyone would like a decent 2048x2048 plain grass texture (used in the picture above) I figured I'd share the one I made: [URL]https://dl.dropboxusercontent.com/u/39952031/grass2048.jpg[/URL]
Rewriting and refactoring is such a pain. It's fine when it's just a single function, but I have to rewrite about 50% of my engine so far to accommodate for me switching data structures.
I recently started a blog where I showcase all my older projects. The quality of the code is pretty bad for some of them since they date from a few years back but maybe some of you might be interested anyway.
[URL="http://hiredk.com/2014/08/19/detention/"]Previous Work Part 10 : Detention[/URL]
[URL="http://hiredk.com/2014/08/19/omw/"]Previous Work Part 9 : OpenMarioWorld[/URL]
[URL="http://hiredk.com/2014/08/19/pattern-rush/"]Previous Work Part 8 : HTML5 Pattern Rush[/URL]
[URL="http://hiredk.com/2014/08/18/castlevania-in-unity/"]Previous Work Part 7 : Castlevania SOTN in Unity[/URL]
[URL="http://hiredk.com/2014/07/27/bullet-network/"]Previous Work Part 6 : Bullet Network (Interpolation)[/URL]
[URL="http://hiredk.com/2014/07/27/terrain-tessellation/"]Previous Work Part 5 : OpenGL 4.0 Terrain Tessellation[/URL]
[URL="http://hiredk.com/2014/07/27/root-framework/"]Previous Work Part 4 : Root Framework[/URL]
[URL="http://hiredk.com/2014/07/27/opengl-engine-rev9-to-rev11/"]Previous Work Part 3 : OpenGL Engine (REV9 to REV11)[/URL]
[URL="http://hiredk.com/2014/07/26/opengl-engine-rev1-to-rev8/"]Previous Work Part 2 : OpenGL Engine (REV4 to REV8)[/URL]
[URL="http://hiredk.com/2014/07/26/zelda-project/"]Previous Work Part 1 : C++ Zelda Project[/URL]
Also, I finally made a video of this:
[video=youtube;Thlp7hFLdGg]http://www.youtube.com/watch?v=Thlp7hFLdGg[/video]
[QUOTE=WTF Nuke;45742601]Rewriting and refactoring is such a pain. It's fine when it's just a single function, but I have to rewrite about 50% of my engine so far to accommodate for me switching data structures.[/QUOTE]
But it feels sooo good when you finish.
[QUOTE=Larikang;45743111]But it feels sooo good when you finish.[/QUOTE]
If only I got this far.
[editline]20th August 2014[/editline]
Also relevant to sex.
[QUOTE=Lemmingz95;45742094]I always thought it was a class [I]A[/I]
Oh hell... what a pageking; here, quick, have a crappy cube thing I made today messing around with OpenGL:
[IMG]http://i.imgur.com/pOQgFn8.gif[/IMG]
[editline]20th August 2014[/editline]
[I]jerky[/I][/QUOTE]
Isn't 55 fps pretty bad for a spinning 2D square?
Sorry, you need to Log In to post a reply to this thread.