I'm looking into books/other resources to do realtime graphics. However, I'm always anxious about getting outdated resources and other stumbling blocks. Some things I've found:
[url]http://www.amazon.com/Antons-OpenGL-Tutorials-Anton-Gerdelan-ebook/dp/B00LAMQYF2/ref=sr_1_2?ie=UTF8&qid=1452724463&sr=8-2&keywords=opengl[/url]
Any recommendations? I'm also interested in doing some Unreal programming and eventually be able to write my own shaders. What do you guys suggest?
[QUOTE=Fourier;49525141]You must have mesh made out of disconnected triangles. That is, vertices are not connected "in-between" triangles.
As you guessed it right, vertices are duplicated, just their normals are different for each triangle.[/QUOTE]
You mean you can achieve this with Unity's default terrain system?
[IMG]http://i.imgur.com/utjjFIr.png[/IMG]
I got multiple for for loops in it now
I really hope Unity improves and expands on their terrain toolset soon. The brush size cap is very annoying when working with large resolutions. It's rather inconvenient to have to edit heightmaps in Photoshop without being able to preview the result before importing.
[QUOTE=srobins;49525041]I'm not sure how it's done specifically in Unity, but isn't flat shading achieved just by not interpolating the surface normals? I'm pretty sure that's all there is to it.
[editline]13th January 2016[/editline]
Or rather, making sure the normals on your poly are all exactly the same?[/QUOTE]
Yeah use "flat out variableName" in GLSL to override interpolation of the normal. A common pitfall is many object loaders interpolate on loading which while still giving a flat shaded look is a lot smoother than might be expected.
I've been putting too much work into this and I don't even remember what I wanted it for in the first place...
Anyone know how to turn a static label into a label that has a border around it while retaining any text given?
Like, imagine the black box in this picture having text in the top left corner, covering part of the line. I don't know the terms to google for this. :v:
[img]http://i.imgur.com/Ju3zQ1m.png[/img]
[QUOTE=false prophet;49527845]I've been putting too much work into this and I don't even remember what I wanted it for in the first place...
Anyone know how to turn a static label into a label that has a border around it while retaining any text given?
Like, imagine the black box in this picture having text in the top left corner, covering part of the line. I don't know the terms to google for this. :v:
[IMG]http://i.imgur.com/Ju3zQ1m.png[/IMG][/QUOTE]
It's called a GroupBox in WinForms.
[QUOTE=Dolton;49526677]Yeah use "flat out variableName" in GLSL to override interpolation of the normal. A common pitfall is many object loaders interpolate on loading which while still giving a flat shaded look is a lot smoother than might be expected.[/QUOTE]
Well even if it does interpolate you'll get flat shading if you have 3 separate vertices per triangle with their normals being the face normal.
Does this someone enable you to have flat shading without duplicating vertices? If so, how does it pick the normal out of the three?
[QUOTE=Darwin226;49527950]Well even if it does interpolate you'll get flat shading if you have 3 separate vertices per triangle with their normals being the face normal.
Does this someone enable you to have flat shading without duplicating vertices? If so, how does it pick the normal out of the three?[/QUOTE]
You could pass the vertices to a geometry shader and take the tree normals and compute the average of them before passing it to the pixel shader.
But that would be ridiculous.
[editline]14th January 2016[/editline]
[I]or would it?
[/I]I mean you would save bandwidth by not having to send duplicate positions and stuff.
You could even calculate the normal from the vertex positions:
[code]
[maxvertexcount(3)]
void GS(triangle GS_INPUT input[3], inout TriangleStream<PS_INPUT> stream)
{
GSPS_INPUT output;
float3 edgeA = input[1].position - input[0].position;
float3 edgeB = input[2].position - input[0].position;
output.normal = normalize(cross(edgeA, edgeB));
// Pass-through all other attributes.
for (uint i = 0; i < 3; ++i)
{
output.position = input[i].position;
output.texcoord = input[i].texcoord;
stream.Append(output);
}
}
[/code]
[QUOTE=DoctorSalt;49525287]I'm looking into books/other resources to do realtime graphics. However, I'm always anxious about getting outdated resources and other stumbling blocks. Some things I've found:
[url]http://www.amazon.com/Antons-OpenGL-Tutorials-Anton-Gerdelan-ebook/dp/B00LAMQYF2/ref=sr_1_2?ie=UTF8&qid=1452724463&sr=8-2&keywords=opengl[/url]
Any recommendations? I'm also interested in doing some Unreal programming and eventually be able to write my own shaders. What do you guys suggest?[/QUOTE]
What are your goals or what do you hope to do in the future?
[QUOTE=Tamschi;49521537]This looks really fun but my phone most likely can't run it. Will there be a PC release later?[/QUOTE]
We're aiming to release it on Windows store, so it's kind-of-a-yes :)
Also, currently I'm struggling my balls to make it work on the shittiest devices on earth, so there's a high chance it'll run on your device ( as long as it''s android 4.2+ or lumia 520+ ).
[QUOTE=chimitos;49525146]Did I miss that in a previous WAYWO? Your game looks amazing! I didn't realize that it was for mobile at first.
[IMG]http://exiin.com/wp-content/uploads/2015/06/LID20.png[/IMG][/QUOTE]
You didn't miss anything, too much work and we wanted to keep the project private while we discussed stuff with some publishers. Anyways, I spent last few months lurking WAYWO thread :p
Here's some bit badly animated 3-day-rushed trailer :
[video=youtube;9qdYIvQxkGs]http://www.youtube.com/watch?v=9qdYIvQxkGs[/video]
[video=youtube;AiwmGzHnDKc]https://www.youtube.com/watch?v=AiwmGzHnDKc&[/video]
Did this terrain change thingy
[QUOTE=Icedshot;49521307]So, I've finished implementing my reliability layer over UDP. Firstly, I can highly recommend *not* doing this, it is a lot of effort (~600 lines of code just for a high level description of the reliability stuff), and not very friendly to debug. I didn't want to swap to TCP with UDP as that'd involve changing the networking architecture of my server quite significantly, and I couldn't be arsed to deal with the fact that TCP is a streaming protocol not a packet based one (sock_seqpacket pls)
That said, this is how it works:
So, the game has a client and server. A client decides it wants to reliably network a particular variable. This variable gets added to the clients outgoing reliability list, and assigned an ID. Every x ms, this variable gets sent to the server until the client receives an ACK (with the ID sent to the server) telling it the server got the data. ACKs are spammed to the client too (again every x ms). This means that if there's any data loss of acks/data, itll simply keep being transmitted until it gets through. This is terribly inefficient
The server then takes this data, and assigns it to the outgoing queue for all the currently connected clients, and the same process above happens of the server spamming the data to the clients, and only stopping once it gets the acks back from the clients.
Data received is kept in an 'incoming' buffer. New data received is checked (id-wise) against the data in the incoming buffer, and discarded if its already in the buffer. This way, even though data is spammed every x ms, the client only sees it happening once. Incoming data is then removed from the incoming buffer after x ms (currently like, 2 seconds)
This is.. well, hideously inefficient, and I almost certainly could have used TCP to a much better effect. However, I was mainly interested to see how difficult it was to write a very basic reliability layer. Surprisingly enough this works pretty well, and means that I can now reliably network eg hp information change, but at the speed of UDP. Hooray![/QUOTE]
Enet's great if you want something like this just atop UDP, but don't exactly want RakNet or other complete game networking infrastructures. Its unreliable mode guarantees you get no out of sequence packets (but no guarantee for each and every packet arriving), so if packets 1,2,3,4 were sent, but recevied out of order in 2,4,1,3, the recipient only gets packets 2 and 4. Best when you really need the lowest latency and only the latest message is important. Of course it also has a speedy reliable mode which handles out of sequence messages as well.
(It also handles a lot of the important flow control, congestion response and bandwidth limits behind the scenes)
Most importantly, I suppose, for game networking where you're already talking in terms of messages and high speed + low latency are very important, it is much better than caving to the "you might as well use TCP at this point, your basically implementing it yourself anyway" opinion.
[QUOTE=DoctorSalt;49525287]I'm looking into books/other resources to do realtime graphics. However, I'm always anxious about getting outdated resources and other stumbling blocks. Some things I've found:
[url]http://www.amazon.com/Antons-OpenGL-Tutorials-Anton-Gerdelan-ebook/dp/B00LAMQYF2/ref=sr_1_2?ie=UTF8&qid=1452724463&sr=8-2&keywords=opengl[/url]
Any recommendations? I'm also interested in doing some Unreal programming and eventually be able to write my own shaders. What do you guys suggest?[/QUOTE]
Investing in a good book will always pay you back tenfold, I'm currently studying the OpenGL Superbible series and they are very very good. The most recent version covers 4.5, the one which covers 3.3 is especially good. They go over some rendering techniques using all the latest types of shaders, the seventh edition even covers compute shaders!
Learning from websites is great, but I have tried that many times and nothing ever "stuck". With my book i can put post-it notes in sections which I like and it also describes things in great detail. It's also nice to hold.
Tuned my bezier curves to bend less when the distance is short. I also used an integrated sine to increase the segment count in the beginning and end of the curve, and reduce it in the middle. I feel like this can be optimized a lot more (i.e. don't use fullscreen quads to render all links, including offscreen links)
[media]https://www.youtube.com/watch?v=NmeHpUK-hC4[/media]
[QUOTE=Anven11;49528134]You could pass the vertices to a geometry shader and take the tree normals and compute the average of them before passing it to the pixel shader.
But that would be ridiculous.
[editline]14th January 2016[/editline]
[I]or would it?
[/I]I mean you would save bandwidth by not having to send duplicate positions and stuff.
You could even calculate the normal from the vertex positions:
[code]
[maxvertexcount(3)]
void GS(triangle GS_INPUT input[3], inout TriangleStream<PS_INPUT> stream)
{
GSPS_INPUT output;
float3 edgeA = input[1].position - input[0].position;
float3 edgeB = input[2].position - input[0].position;
output.normal = normalize(cross(edgeA, edgeB));
// Pass-through all other attributes.
for (uint i = 0; i < 3; ++i)
{
output.position = input[i].position;
output.texcoord = input[i].texcoord;
stream.Append(output);
}
}
[/code][/QUOTE]
Yeah I doubt a game that utilizes flat shading is likely to come close to the bandwidth limit to the GC.
On the other hand the geometry shader solution is more elegant since you don't need to change your data.
[QUOTE=sarge997;49525365]You mean you can achieve this with Unity's default terrain system?[/QUOTE]
No, sorry, I got out of context.
[thumb]http://i.imgur.com/bokgp8B.png[/thumb]
Executing an arbitrary native dll that resides on the root directory of my SD card. Surprisingly, it was simpler to execute a native one than a managed one (still no luck with that).
[editline]14th January 2016[/editline]
Windows phone 10
[code]
typedef void(__cdecl *PrintFunc)(const char* Str);
extern "C" __declspec(dllexport) void EntryPoint(PrintFunc Print);
void EntryPoint(PrintFunc Print) {
Print("Hello C++!");
}[/code]
Some more fixes to my cloth, I assumed that both shear and linear constraints had the same rest length (derp) and I also changed it to 3D to fix the points acting odd when close together.
[vid]http://richardbamford.io/dmp/cloth_sim_3.webm[/vid]
(is there any way to thumb videos?)
[quote][vid]http://richardbamford.io/dmp/cloth_sim_3.webm[/vid][/quote]
I believe the only way to thumb videos is to put them in a quote tag or resize the actual video. Quotes do make them very small as you can see however.
Fuck yes this is so satisfying:
[media]https://www.youtube.com/watch?v=jaShwoe2920[/media]
[QUOTE=Trebgarta;49529549]That is very cool! What are you going to make with that?[/QUOTE]
I'm trying to create software for live VJ-ing using a graphical scene editor. The graphical scene editor will then be used to generate python or C++ code (I haven't decided yet) to display live visuals with opengl.
Cuda cloth sim: 256x256 mesh with 32 constraint iterations per frame.
[IMG]http://i.imgur.com/aDLvotL.png[/IMG]
its obviously way higher res than it needs to be, but I dont have the code in place to create multiple instances of lower res cloth yet so this can emulate the perf req of that.
wireframe:
[IMG]http://i.imgur.com/9vGwKaj.png[/IMG]
~18ms per frame on a GTX 980.
[QUOTE=Bambo.;49528951]Some more fixes to my cloth, I assumed that both shear and linear constraints had the same rest length (derp) and I also changed it to 3D to fix the points acting odd when close together.
(is there any way to thumb videos?)[/QUOTE]
How are you simulating the cloth? It looks pretty artificial to be honest.
[QUOTE=Berkin;49527853]It's called a GroupBox in WinForms.[/QUOTE]
Of course it's a button control... of course...
[QUOTE=Tommyx50;49530094]How are you simulating the cloth? It looks pretty artificial to be honest.[/QUOTE]
It looks very elastic and as if it's emerged in a viscous fluid. It's pretty good if that's what he's going for :v:
[QUOTE=Asgard;49524668]That moment when you go into your 3-year old code and find ascii art
[t]http://i.imgur.com/2w8MeXR.png[/t][/QUOTE]
This is currently in our master branch at work. I once had a coworker say that out loud after reading my docs.
[img]http://i.imgur.com/WSR819k.png[/img]
[img]http://i.imgur.com/iu4KFTj.png[/img]
[QUOTE=Tommyx50;49530094]How are you simulating the cloth? It looks pretty artificial to be honest.[/QUOTE]
Simulating it as a set of point masses constrained by its 8 neighbors, using Hookes law to calculate the forces involved.
Yes it is artificial! Accurate physics simulations are hard, but you learn so much by trying to implement them.
I'm not aiming to create a system that works as perfectly as alien_guy's, i'm in the process of bashing out lots of concepts to learn the standard basics of 3D graphics. Check me out here! [url]http://richardbamford.blogspot.co.uk/[/url]
I've been thinking that my cloth would probably be a better "water surface" simulator if it was changed about a bit... I dunno!