(April 2022) Monthly WIP Screenshot Thread

Ah, interesting.

Edit: that didn’t seem to fix the problem.

This probably deserves a separate thread but I find the whole idea of “animation length” unsettling in Blender where there seems no good way to specify the number of frames other than to have some ending keyframe.

blendableAction.setTransitionLength(0) is the next thing you should try. By default it is 0.4f second.

…but that’s desirable when transitioning from one animation to another, no? And I would think shouldn’t be used at all for a looping animation.

Anyway, I will look into it more at some point and create a forum thread for it. This has annoyed me for some time. I have some models with no looping issues but I did not create those GLTF… so I know it’s possible to get JME to play them “out of the box” with the right GLTF.

Edit: by the way, thanks for trying to help.

2 Likes

Simple swimming system:

8 Likes

Simple cover system:

10 Likes

@capdevon Great to see, well done !! This will be very helpful when dealing with open world action games, do you plan to build an API ?

1 Like

Thanks @Pavl_G . I don’t currently plan to write an API. Maybe later.
Now I’m focusing on the shaders. I’m trying to figure out how to quickly write and test shaders. I’d like to share knowledge and useful tools with the community to do it quickly and easily :slight_smile:

4 Likes

Working on a dynamic character builder system for my game, so players will be able to customize their own character, but more importantly so the world can be filled with interactable NPCs that aren’t all identical to the player’s character (which has been the case up until now)

I modified my shader for cosmetic features to alter the hue saturation and brightness dynamically so there’s a wider range of color options for the hair, eyes, skin, etc.

here’s a quick preview altering the HSV with in-game commands. (Still need to make a visual editor for making a character thats user-friendly, but first I am making sure that my plans are going to work)

I am using the open source MakeHuman application to generate the humanoid body and all the other parts of the character except for clothing. They have about 10 different hair, eye brow, and eye lash options, so the next step is to export all of these features and put them into individual .j3o files, and also to make a base male model. I suspect I might also need to export a new version of each eyebrow/eyelash option for the unique male spatial since the facial structure changes with gender in makehuman, and I will also need to make adjustments to the shared armature so all my animations are clean on the male model. So i expect it will be a tedious process, but hopefully will be well worth it once finished.

9 Likes

A quick question, Just wondering something.

Why use a shader to adjust skin,hair, eyes and etc… Color.
Why not paint them in “White shades” to get depth and tone. and apply a color to that, so you can make it brown, blonde and such…

Just like to know why use a shader (Special) to adjust shader when just giving a color and be applies ontop of white to get the desired affect.

This is what I do for flowers and such, have apply a color to the “Buds” not stem, so I can get blue, green, red flowers and such.

Just wondering what you might be doing. ALways, looking for new ideas.

3 Likes

That was my initial plan, and would have worked alright for something like the eyes since eye color is usually all one color.

But by altering the Hue in HSV color space instead, the final color of a hair style or piece of clothing can be multi-colored, and I don’t need to desaturate the image to make it white, so I could have purple hair with green highlights for example.

I believe the HSV color space was specifically intended for editing colors in a way that is more sensical to humans, since it splits a colors Hue, Saturation, and Brightness into the x, y, and z components of a vec3. So instead of having to adjust all 3 components of a blue color to shift it to orange in RGB space, you can convert your RGB color to HSV, then change only the x component to adjust the hue to any color. So If you add 0.5 to the x component of an HSV vec and convert back to RGB, you’ll essentially invert all the colors.

I don’t know if I’m explaining it as best as possible, most of my understanding of working with Hue/Saturation/Brightness editing is from using Gimp’s visual editor for editing texture’s Hue Saturation and Brightness which has always been very useful to me, and then @RiccardoBlb recently suggested this shader code when I was working on something else and I realized how easily I could make my cosmetic shaders work to adjust hsv as well

vec3 rgb2hsv(vec3 c){
    vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
    vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
    vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));

    float d = q.x - min(q.w, q.y);
    float e = 1.0e-10;
    return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}

vec3 hsv2rgb(vec3 c){
    vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
    vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
    return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}

So the command I’m calling in my video is setting the vec3 variable named m_HSVScalar that’s used by this code in my shader

    vec3 colorHSV = rgb2hsv(albedo.rgb);
    
    colorHSV.x += m_HSVScalar.x;        //add hue
    colorHSV.y += m_HSVScalar.y ;        //likely better off multiplying S and V values by a positive value instead of adding
    colorHSV.z += m_HSVScalar.z;
    
    vec3 newColorFromHSV = hsv2rgb(colorHSV);
    albedo.rgb = newColorFromHSV.xyz;
7 Likes

I get it, that actually sound so much nicer. Here is a link to someone showing them doing basically the same thing.

Nice results in taking that original image and changing it to a blue HUE and comes out nice.

Thanks for your information, I really think it is a very big step up.

2 Likes