Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 14 Feb 2007
Online Last Active Today, 06:44 PM

Posts I've Made

In Topic: AngelScript execution speed?

Today, 06:44 PM

i don't know, the AngelScript is eaven slower than lua

Almost every scripting language is slower than Lua. Lua is pretty much the fastest interpreted language around (without JIT). With the addition of LuaJIT, it's unnaturally fast.

You should expect "scripting languages" to be 2x to 20x slower than C.
They trade speed for other benefits.

In Topic: Questions about Physical based shading(PBS)?

Today, 02:58 PM

If a simple refection map is physically based then I don't know what is not physically based.

A simple reflection map is not physically based. A complex IBL system can be.
e.g. instead of just taking an environment map and texturing it on there to get a gloss effect (which will intuitively look good, but is not going to match the real world), if you ray-traced that environment as a surrounding sphere and integrated a thousand different rays using a physically-based BRDF and importance sampling, then your results would come close to matching the real world. The key is using a Physically-based BRDF to represent the surface, as 'shading' is all about surfaces.

Modern games do do the above, but with some clever approximations. The result of importance sampling that sphere can be done ahead of time and stored in a big look up table... The problem is that it's many-dimensional and would be way too big, so the common approximation basically stores it as a 4D cube array plus a 2D error correction table.
The final implementation looks like simple reflection mapping, but the inner workings are based on physically plausible BRDFs, ray-tracing and importance sampling (or unbiasedMonte carlo sampling if you like), and most importantly, in many cases the results get quite close to the ground truth, similar to the hideously expensive true ray tracing renderers but at a fraction of the cost.

In Topic: D3DQUERYTYPE_TIMESTAMPFREQ Always GetData equal to 0.1GHz

Today, 07:04 AM

That's not necessarily the GPU clock frequency... it's just the frequency of some abstracted clock that D3D9 has decided to use.

10 nanosecond resolution is good enough to implement coarse-grained profiler with, which is all the D3D9 timer events are good for anyway.

In Topic: Shader class design question

Today, 01:19 AM

- it's not useful/ worth it to handle a VS and PS as a completely different object
- in practice you should 'author' an 'Effect'(shader) which consists of a passes, a vertex shader, pixel shader, maybe a geometry shader and more
-- the effect can have many/ multiple permutations (like the ubershader principle)
- a VS should always be linked to some PS and the other way around;
-- chances that you'll be mixing VS/PS combinations in runtime, independent from the assets/ content you load.
- this also means that there should be a balance in codebase/ design flexibility and assumptions on the pipeline/ content generation.
From this I conclude it might be actually better to create 1 class for an 'effect', for now having just a VS and PS.

Yeah I'd definately go for having something like a "Program" class, which contains a full set of VS/PS/etc... If you ever want to port to GL, it actually prefers that you work this way anyway!
Sure, if you go with "effects", you can start with effect having one program, and expand it to being able to select one from a collection of permutations/passes.

Note that it's valid to have a program that contains a VS but no PS -- this is common for depth-only rendering.

In Topic: Underrated game genres that are really good.

Yesterday, 09:14 PM

Modempunk Space Trading Games