Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 19 Jul 2011
Offline Last Active Jun 11 2016 05:38 AM

#5273463 Loosing materials when adding IK transformations to the bone?

Posted by Alundra on 31 January 2016 - 07:36 AM

frame->TransformationMatrix += matFinal;

You have to multiply matrices to combine them (in the good order).

#5272302 (UE4) Use button in inventory to show/hide items.

Posted by Alundra on 22 January 2016 - 04:57 PM

One option is to have a list of item with one parent which is the category, each category like that.

Then it's only needed to make one parent visible to have all these children visible (or if visible is not inherited, set visible on each child).

#5271451 Calculating Cylinder Width and Radius

Posted by Alundra on 16 January 2016 - 03:22 PM

On the same road as Randy Gaul said, if I understand correctly what you ask :

1) Simply for loop each vertice and find the min/max on the x axis and y axis.

2) Radius = 0.5f * (m_Max.x - m_Min.x)

3) Height = m_Max.y - m_Min.y

#5269621 Moment Shadow Maps for Single Scattering, Soft Shadows and Translucent Occlud...

Posted by Alundra on 06 January 2016 - 08:32 AM


here a video about the update of the MSM shadowing technique :

I remember MJP did an article about it and said EVSM still the best, is it always the case ?


#5269492 Memory Leaks on shutdown of QT application

Posted by Alundra on 05 January 2016 - 03:50 PM

I found exactly where the leaks happen, it's when the render window is resized, maybe because I don't clean up correctly everywhere the set of variables of shaders and because of that the release count never go down to 0, if it's the reason, the leak then has nothing to do with Qt, it's an engine issue.

#5268839 Axis aligned boxes and rotations

Posted by Alundra on 02 January 2016 - 10:58 AM

Whatever else you need is a separate object which is attached to the scene node.

In other words : components.

#5268834 Keyboard/Mouse input missing because of low FPS

Posted by Alundra on 02 January 2016 - 10:05 AM

I missed one information you right, it only happens on action in the mode "Press Once" (example : character punch on the mouse left click).

It's surely because of mouse down + mouse up events ? On this case the state of the action is then not actionned and the game code will never do the action.

I use 3 modes "Hold", "Press Once" and "Release Once", surely the "Release Once" mode has the same issue.

#5268147 IMGUI

Posted by Alundra on 27 December 2015 - 04:22 PM


IMGUI becomes populare but is it good for everything (game, debug, editor) ?

What is your opinion about it ?


#5266440 Axis aligned boxes and rotations

Posted by Alundra on 15 December 2015 - 06:03 AM

This is what I said in my previous post, you have a flag and if it's needed to update local or world transform then you update.

But also, what you do is very inefficient because you update surely multiple time in an hierarchy.

What irrlicht do is common way, it gets the parent world transform recursively when needed.

Using the flag, if the parent is already updated, you end with a simple get of transform.

#5266167 Axis aligned boxes and rotations

Posted by Alundra on 13 December 2015 - 04:58 PM

To manipulate position, rotation and scale separately but then of course you have the 4x4 matrix.

You can use a flag + mutable keyword on the 4x4 matrix to check if it's needed to compute the matrix if position, rotation or scale changed.

#5265376 Writing 'floats' to a file

Posted by Alundra on 07 December 2015 - 09:15 PM

Also don't forget endian will be needed to know when reading, you can add the endian type on the beginning of the file in save process.

#5265125 Unity C# Jump Code Was Working. Now It's Not.

Posted by Alundra on 06 December 2015 - 07:36 AM

Public variables are there to allow artists to set up values on editor, your rigidbody has no sense to be public since it's only used for this class.

#5265080 Specular aliasing : The order 1886 method

Posted by Alundra on 05 December 2015 - 06:02 PM

There's ALSO a really nifty demo showing LEAN, CLEAN, and Toksvig results so you can see them all side by side with performance, but I don't know where it is.

You surely speak about : https://mjp.codeplex.com/releases/view/109905

#5265044 Specular aliasing : The order 1886 method

Posted by Alundra on 05 December 2015 - 12:30 PM


this paper shows a method to compute a normal+roughness map which gives a result not far from the ground truth :


Here the code from the paper :

// ===========================================================================================================
// Computes a new roughness value for a single mipmap texel given a normal map and an existing roughness value
// ===========================================================================================================
float ComputeRoughness(in float2 texelPos, in uint mipLevel, in float roughness,in Texture2D NormalMap)
  if(mipLevel == 0)
    return roughness;
    float3 avgNormal = 0.0f;
    // Sample all normal map texels from the base mip level that are within
    // the footprint of the current mipmap texel
    const uint texelFootprint = (1 << mipLevel);
    const float2 topLeft = (-float(texelFootprint) / 2.0f) + 0.5f;
    for(uint y = 0; y < texelFootprint; ++y)
      for(uint x = 0; x < texelFootprint; ++x)
        float2 offset = topLeft + float2(x, y);
        float2 samplePos = floor(texelPos + offset) + 0.5f;
        float3 sampleNormal = NormalMap[samplePos].xyz;
        sampleNormal = normalize(sampleNormal * 2.0f - 1.0f);
        avgNormal += sampleNormal;
    // Fit a vMF lobe to NDF for this mip texel
    avgNormal /= (texelFootprint * texelFootprint);
    float r = length(avgNormal);
    float kappa = 10000.0f;
    if(r < 1.0f)
      kappa = (3 * r - r * r * r) / (1 - r * r);
    // Compute the new roughness value
    return sqrt(roughness * roughness + (1.0f / kappa));

Is it the best known solution or more advanced research was made nowadays ?


#5264055 How to use mouse as view control of camera?

Posted by Alundra on 28 November 2015 - 11:25 PM

Here a code to manage sensitivity and smoothing :

// Compute the real x and y values by accounting for smoothing.
lastX = lastX * m_viewSmoothing + ( x * elapsed ) * ( 1.0f - m_viewSmoothing );
lastY = lastY * m_viewSmoothing + ( y * elapsed ) * ( 1.0f - m_viewSmoothing );

// Adjust the values for sensitivity.
float sensitivity = 1.0f / elapsed * m_viewSensitivity / 100.0f;
if( sensitivity > 4.0f )
  sensitivity = 4.0f;
if( sensitivity < m_viewSensitivity )
  sensitivity = m_viewSensitivity;
sensitivity = sensitivity / 4.0f;
lastX *= sensitivity;
lastY *= sensitivity;

Default values can be :

m_viewSmoothing = 0.5f;
m_viewSensitivity = 0.65f;