Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 03 Jul 2003
Offline Last Active Today, 09:09 AM

#5289234 Procedural character animations. What is the state of the art?

Posted by swiftcoder on 29 April 2016 - 07:57 AM

Eskil's confuse is also pretty neat along those lines.

#5288312 BGFX and micro-shaders?

Posted by swiftcoder on 23 April 2016 - 10:50 AM

Yes, most of these systems work by concatenating together small fragments of GLSL code. Some fragments can be chained together, others are mutually exclusive. Not only is lighting a part of this system, but so is the vertex transform pipeline, because you need to be able to account for the differences between basic and skinned meshes.



For example, a single material might be composed out of the following chunks:

- Vertex Skinning

- Diffuse Map

- Normal Map

- Lighting Equation with Specular


And another might use:

- Basic Vertex Transform

- Vertex Color

- Environment Map

#5288135 Planet Rendering: Spherical Level-of-Detail in less than 100 lines of C++

Posted by swiftcoder on 22 April 2016 - 08:37 AM

Thats basically what happens. I set 3 corner coords of a patch in the vertex shader, the rest is interpolated. Maybe I should first multiply the matrices to avoid a precision loss

I hadn't looked closely enough to realise you are doing this on the GPU.

I did that at first, but abandoned it several years ago in favour of calculating all vertices on the CPU, due to a number of precision issues in GPU land. YMMV.

#5287976 Planet Rendering: Spherical Level-of-Detail in less than 100 lines of C++

Posted by swiftcoder on 21 April 2016 - 09:03 AM

Basically it works nice, but once you go up close then float precision is not enough. What is the best solution to that other than splitting the frustum in near / far ?

Generally you can get away with having each vertex defined relative to the center of the patch which contains it, and rendering patches relative to the camera... Not necessarily ideal for a recursive implementation.

#5287474 Is inheritance evil?

Posted by swiftcoder on 18 April 2016 - 09:52 AM

Implementation inheritance, as provided by mainstream object-oriented languages, is fundamentally evil. I'm a little surprised that statement is even controversial.
This isn't a new observation. The change in paradigm here came in the mid 90's, when people started noticing the limitations and flaws of implementation inheritance, and transitioning to interface inheritance. Robert Martin's original article on the topic is a worthwhile read.
If you look around enterprise software, there aren't a whole hell of a lot of meaningful software projects still clinging to implementation inheritance as the default. Unfortunately, game development software is full of such warts, I think in part because many of the open source game engines were conceived of in the early 2000's, and haven't really seen a rewrite since.

#5287238 BGFX and micro-shaders?

Posted by swiftcoder on 16 April 2016 - 06:19 PM

Do you recommend any books or articles covering such shader generating system?

Not to hand. Such systems range from perl scripts that munge together fragments of GLSL source code, all the way to fancy graph editors like Unreal has.

#5287201 BGFX and micro-shaders?

Posted by swiftcoder on 16 April 2016 - 11:10 AM

Let it not ever be said that BGFX's samples demonstrate the way you should be doing much of anything. 90% of those files are just setting up preprocessor constants.


In a practical scenario, you'll probably have a shader generator system that generates all those combinations at build time from your own intermediate shader representation.

#5287200 Smart tricks / hacks

Posted by swiftcoder on 16 April 2016 - 11:07 AM

My editor knows how to jump to matching parentheses, but it doesn't know how to jump to a matching 'start of statement' from and 'end', so how to solve this?

Get a better editor?

Any competent editor should be able to figure out the beginning/end of a scope in languages with syntactically-significant whitespace these days.

#5287129 Is inheritance evil?

Posted by swiftcoder on 15 April 2016 - 08:34 PM

As others have said, one must distinguish between "interface inheritance" and "implementation inheritance". Speaking in generalities, the former is a good thing, and the latter almost exclusively a bad thing.


However, and this is a fairly large caveat, in languages such as Java which lack any concept of mixins, one ends up having to use implementation inheritance to achieve a poor-man's version of mixins... so we don't have the leeway to disallow it entirely.

#5285627 [ANSWERED] Questions about public WiFi vs private WiFi

Posted by swiftcoder on 07 April 2016 - 02:05 PM

Most corporate firewalls block ICMP packets, many university firewalls do as well. I guess the theory is that it makes snooping around the network a little harder.

#5285608 Planet Rendering: Spherical Level-of-Detail in less than 100 lines of C++

Posted by swiftcoder on 07 April 2016 - 10:28 AM

This is really cool. You've distilled the process down further than I've ever attempted :)

#5284273 Authenticating users

Posted by swiftcoder on 30 March 2016 - 09:34 AM

OTOH, 2fa does solve this particular attack

Unfortunately, many options for 2fa don't reliably solve this particular attack. For most of the popular options (say, gmail's 2fa), an attack site can fake the page that pops up to say "enter your 2fa code here", and use the code and password the user enters to establish their own connection to google's servers...


Particularly because federated login via google, facebook, etc. is so common these days, users are trained to enter their 2nd factor when the page looks like the federation source popup. The only real defense here is to equip client software (i.e. browsers) to identify similar pages vended without the correct vendor server certificate - but that's a hard problem.

#5283973 interactive tutorials are quests?

Posted by swiftcoder on 28 March 2016 - 07:59 PM

StarCraft (and all Blizzard games since) do this as well. Pretty much all modern shooters do this (although most assume a base level of competency in shooters).


In general, I think we've reached a point where the "massive wall of text" style of tutorial is a *huge* turnoff to potential players. I fired up an older RTS the other day, and the hand-holding and walls of text take what feels like an hour to get through, before you can play the damn game. Don't do that to your players.

#5281809 Authenticating users

Posted by swiftcoder on 17 March 2016 - 11:56 PM

Do you have a link for the DTLS support in OpenSSL? I have not been able to find much on that when googling :/

That's why I called DTLS a "can of worms". OpenSSL has supported it since about 2005, but there's no real documentation or examples. Your best bet would probably be to read the DTS specification, assuming you already have a background in regular TLS...


Using SSL for communicating with the server seems like a large amount of overhead once the client is authenticated... Is there a performance overhead by sending every packet through SSL?

Most of the overhead is involved in establishing the connection. Overhead once the connection is established is pretty minimal - enough so that it's unlikely to be a bottleneck in this day and age.


When the client is authenticated, as long as I map the PlayerId from my database with the IP that the user is authenticated with, can I send any non-sensitive data (like location updates and chat messages) over as plain text to the authenticated IP?

I assume you mean the IP + port #, since IP alone isn't sufficient to identify a client behind a NAT gateway. And yes, if you aren't worried about wire tampering, that's a fine way to go. But the initial authentication every time they connect needs to be secure.

#5281249 C++ Self-Evaluation Metrics

Posted by swiftcoder on 14 March 2016 - 02:05 PM

The corollary to this is that if you write "C++ Expert" on your resume, many interviewers will make it their mission to find every last thing you don't know...