Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 07 Mar 2009
Online Last Active Yesterday, 11:54 PM

Posts I've Made

In Topic: Atmospheric Scattering

Yesterday, 11:52 PM

are you rendering with HDR and tonemapping ? simulating sun lighting without that is really cumbersome, it's not just brightness, but also looks like it affects the shape of the sun etc. (because it's not just a sharp sphere, but rather a glowing center with fall off and the tone mapping s-curve adapts it to look as you'd expect).

In Topic: Slerp over a triangle?

Yesterday, 11:49 PM

I think L. Spiro's suggest should lead to the undistorted sphere you want.

otherwise, describe the problem in more detail and why your slerps don't help. I'm sure we'll find a solution together.

In Topic: C++ as a scripting language

Yesterday, 11:41 PM

I wonder what your goal is in the first place, why are you trying to add scripting?

One peculiarity of the game I am developing is that I am not currently planning on implementing a scripting language. ... I chose to do this as I am currently the only developer of the game, and I am very comfortable with writing C++.

that's not really scripting. it sounds like "I'm adding a level editor to my engine, but as I'm the only dev, I will use visual studio and write the levels as text files" ;)
as the only one writing code in your project, why do you want to add scripting at all? are you trying to emulate edit&continue?

scripting is usually some higher level access to some exposed parts of the engine for non-engine programmers (or non-programmers in general). Game designers or level designer can stick together complex stuff by using simple instruction like "spawn enemy, goto door,...".

so it's a bit confusing why you're 'scripting' and what you mean by it.

I'm also comfy with c++ like you, but I use 'scripts' in my engine usually anyway. e.g. to have config files, because it's handy to write something like
health = 100
armor = health*10
and let lua do the math. I also have quite some places where virtual function calls also have a class with specialization to run scripts, e.g. some "Think" function for AI. most AI is c++ and well optimized, but some AI is just for that one moment and I don't care it's messy.
I feel like I don't want to have some c++ code that is adjusting the height of some 3d model for a cutscene just because it has to stand on something different than originally planed and artist cry they'd need to do the whole animation track again if they have to move the character mid way of it up.

in some games I've also used scripting for multiplayer, as scipts never knew where those were running, so I could either sync the changes they do to the world, or I could run the scripts on every instance of the world (so at every player + server) and reproduce the same output.

In Topic: If-else coding style

29 June 2015 - 02:23 AM

that's something that should be resolved with the reviewer instead of some guys in a forum.
otherwise you will never know for sure what the reason was and might repeat the error.

In Topic: SIMD and Compilation

27 June 2015 - 11:22 AM

Intrinsics are the only option when you want to extract 100% performance from the machine. Keep them in mind when you really really need to optimize a loop!
Assembly is pretty much unnecessary -- just use intrinsics.

lets say 90% without assembly ;)
while compilers are indeed very good at it, probably better than someone who's into SIMD for a year, those still have 2 problems.
1. compiler don't know the use case, thus they optimize in a generic way. for example, they don't know how critical one function vs another function is. the more critical should maybe be more aggressively optimized. if you optimize all functions to the maximum, you might cause the opposite e.g. due to unrolling be always instruction cache limited.
2. compilers have to assume the worst and guarantee correctness. you are most likely not aware of some weird case the compiler assumes that causes the compiler to drop a potential optimization.

but the simple solution to it, without _writing_ assembly, is simply to learn to read assembly. Read what the compiler has generated, sometimes a simple change of the order of parameters can save temporaries etc.

also, if you can get your hands on the intel compiler, you can make it spit out annotations to your code that will tell you what the compiler assumes and what optimizations it had to drop and if you're sure what you're doing, you can follow the hints to empower the compiler to optimize. Sometimes it's just as simple as adding pragmas or keywords (e.g. __restrict).

recently there was another SIMD optimization paper from Intel: https://software.intel.com/en-us/articles/easy-simd-through-wrappers