imagination XD

realizing dream


1 Comment

[Unity] Realtime Lipsync


Back on my manual lipsync using Tagarela. This one is faster to do and also easier, but of course, you’ll get only Anime lipsync (Anime lipsync only have 1 open mouth, there’s no O, U, I or any other mouth shape than A).

The method I’m using is just get Audio Source frequency. So basically it’s like music visualisation but for mouth.

What you need

  • Head mesh with 1 mouth blendshape
  • Voice
  • Audio Source

Here’s the script you should attach to head mesh.

using UnityEngine;
using System.Collections;

public class RealtimeLipsync : MonoBehaviour {

//LIPSYNC CORE
 [Header("Lipsync")]
 public AudioSource audioSource;
 public int mouthBlendShape;
 private float[] _samples = new float[64];
 private float clampedLipsync = 0f;

//PRIVATES
 private SkinnedMeshRenderer blendMesh;

void Awake(){
 blendMesh = GetComponent<SkinnedMeshRenderer>();
 }

void LateUpdate(){
 if(audioSource) DoLipsync();
 }

void DoLipsync(){
 if(audioSource.isPlaying){
 audioSource.GetSpectrumData(_samples,0,FFTWindow.BlackmanHarris);

clampedLipsync = Mathf.Clamp(_samples[2]*3000,0,100);

blendMesh.SetBlendShapeWeight(mouthBlendShape,clampedLipsync);
 }
 }
}

And here’s how to do it

  1. Attach this script to your head mesh.
  2. Also don’t forget to add audio source and assign audio source in this script. You can put Audio Source in whereever you want, but remember to assign audio source variable on this script.
  3. To play sound, use like audioSource.clip = <your clip name>; then audioSource.Play();
  4. Assembly-CSharp - VertexScriptCOREPlayerCORE.cs - MonoDevelop-Unity
  5. Here’s my example to use this. I put it on my player script. It’ll automatically works whenever you have audioSrc.clip = clipName; audioSrc.Play();
  6. That’s it, your mouth will move whenever the audio src playing sounds.

 


1 Comment

Nakane Eri mod for Left 4 Dead 2

You can now play as Nakane Eri on Left 4 Dead 2 (Replace Rochelle). Phew, it’s really tiring to get my model works on L4D2, I get a lot of missing textures. I’ll probably do more character later, because I need to concentrate on doing my CORE.

Download Here!

Also don’t forget that she also have LINE Sticker!

wpnknlstck

Thanks for downloading!


Leave a comment

[Unity UI 4.6] Parallax style menu

So yesterday I was trying to make parallax styled menu with Unity 4.6 UI, although it’s very simple to do.

  1. UnityUIPar (1)
  2. Check your canvas setting, the render mode should be Screen Space Camera.
  3.  UnityUIPar (3)
  4. After that, add empty game object like Content. Content is like a group of everything that will be moved by script
  5. UnityUIPar (2)
  6. Add this script on Canvas and set Canvas variable as your Content Rect transform.
  7. also you need to adjust minMaxAxis, it’s an array, 0 usually -15, and 1 usually 15

Here’s the script (C#)

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class ParallaxMenu : MonoBehaviour {

 public RectTransform canvas;
 public float smoothTime = 0.3f;
 public float minMaxXAxis = new float[2]; //0 min, 1 max
 public float minMaxYAxis = new float[2]; //0 min, 1 max
 public float mouseSensitivity = 50.0f;
 private float xVelocity = 0.0f;
 private float yVelocity = 0.0f;
 private float x;
 private float y;
 private float xSmooth;
 private float ySmooth;

 void Awake(){
 Cursor.lockState = CursorLockMode.None;
 Cursor.visible = true;
 }

 void Update(){
 x -= Input.GetAxis("Mouse X") * mouseSensitivity * 0.02f;
 y -= Input.GetAxis("Mouse Y") * mouseSensitivity * .02f;

 if(y > minMaxYAxis[1]) y = minMaxYAxis[1];
 if(y < minMaxYAxis[0]) y = minMaxYAxis[0];
 if(x > minMaxXAxis[1]) x = minMaxXAxis[1];
 if(x < minMaxXAxis[0]) x = minMaxXAxis[0];

 xSmooth = Mathf.SmoothDamp(xSmooth, x, ref xVelocity, smoothTime);
 ySmooth = Mathf.SmoothDamp(ySmooth,y, ref yVelocity, smoothTime);

 Quaternion parallax = new Quaternion();
 parallax = Quaternion.Euler(ySmooth / 7,xSmooth/7,0);

 canvas.transform.localPosition = new Vector3(xSmooth, ySmooth, 0f);
 canvas.transform.localRotation = parallax;
 }
}
momoeline


1 Comment

Momoe Line Sticker Available to download! [EN | JP]

EN | 英語

momoeline

Kitagawa Momoe is now Available to download on LINE! She’s character for my upcoming game. She claimed to be console gamer, but she’ll get mad if you call her “Console Peasant”. Well, short, console gamer, tsundereish, flat, how bad could it be ?

Also check out Nakane Eri Line Sticker here!

Thanks for downloading!

momoelinewp

JP | 日本語

momoelineJP

北川百恵のステッカーはLINEでダウンロードすることができるよ!彼女は私のゲームのために作ります。

LINEステッカーダウンロードこちら


Leave a comment

Nakane Eri Line Sticker !

nakanebanner

Yeah, my first Line Sticker!!! I’ll do Other variation with other outfit and other character later. Anyway, I should release it both Japanese and English version, but I don’t know how. So yeah, next version will have both language.

Thanks for downloading!!!

Preview

LineUserStickers

The Process

The actual idea I was making Nakane Eri Line Sticker is because I wanted to test out my blendshape and model if this model is fully animateable. I can’t draw so I just use 3D renders.

I began making it on December 3, 2015. And yeah, it’s full 3D, I just use Cinema 4D’s Sketch and Toon.

IMG_20151206_150915

And all was finished on December 5, 2016. And then Midnight Rendering!!!

IMG_20151206_150646

Rendering finished on December 6, 2015. Phew, rendering 40 images is real tiring. Rendering is kinda slow, about 5-7 minutes per images. But most of my renders are broken, so I proceed post processing session to clean broken lines.

IMG_20151206_152234

And now, I began add some text. Also adjust to Line Sticker format, about 370 x 320 PNG size and your canvas should be 350 x 300.

IMG_20151206_163532

I began submitting Line sticker at night on December 6, 2015. On December 10, 2015, my sticker is now ‘In Review’. During reviewing process, I can see that they actually access this site, I don’t know how they know this site. And on December 17, 2015, This sticker is approved by Line! Well, it was pretty ironic tho, that I didn’t get my sticker free even as creator.


Leave a comment

[3D] Upload Fake Cel Shade Outline on Sketchfab

Again, this is not related to game dev, but it might be useful for who want to upload cel shade on sketchfab. I’ll be using Cinema 4D, and I think it’ll compatible with all 3D Software out there. Let’s jump to the point:

  1. Get your models sketchfab ready, make sure that you don’t have any bones / skin. You can just bake the skin. Then Combine / Merge all of your model into one mesh.sketchfabx0
  2. Now make a new black material, just ignore that Display tag I add, but adding display tag would make it easier to see. In Cinema 4D, right click your outline model and choose Cinema 4D Tags > Display then turn on Backface Culling.sketchfabx1
  3. Go to Polygon / face mode, and select all, and then extrude it a little.
    sketchfabx2
  4. This is not really necessary, but this could lighten up your model. After extruding, reverse selection your polygon selection and then delete it. In Cinema 4D, press U+I
    sketchfabx3
  5. Now select all again and then reverse normal, in Cinema 4D, press U+R
    sketchfabx4
  6. Now you finally get fake cel outline, let’s export to FBX and upload to sketchfab.
    sketchfabx5
  7. Choose black outline material that you created and set Face Rendering to Single Sided. And you just need to setup your model. If you want to get Cel shade, then use Emitter on all your model without any diffuse or something.
    sketchfabx6
  8. Take a look at my fake cel outline

https://sketchfab.com/models/31ea843181114fda84d8895b7610e936/embed

Akemi Homura
by IMGVERTEX
on Sketchfab


Leave a comment

[C4D, Maya, Blender] Convert FBX to MMD

This is not game dev related, but you can also import your MMD’ed FBX model to Unity, and it gives you better physics simulation using stereoarts’ MMD4Mecanim, read tutorial here.

Anyway, I maybe will stop posting about tutorial, cause I think I post too much that my blog almost become educational site. Beside, I think there’s enough tutorial on Unity. I’ll maybe post a research about porting 2D traditional anime to Unity 3D Cel shaded Anime or Unity tips, not tutorial anymore.

On my previous post about MMD, I only tell you how to import PMD or PMX to Unity, but now, I’ll tell about how to make your own MMD model using Maya, Blender, or Cinema4D. You can also import PMD model to Cinema 4D by using MMDTools.

If you already made model with Blender, you could simply jump to step 3, and export it as PMX by using Blender2Pmx.

In this post, I’ll use Cinema 4D.

What you need is

  1. c4dmmd0Prepare your 3D character and get it MMD compatible. Everything must have skin, don’t attach head mesh to head joint. Blendshape is supported on latest version of FBX (2014 or 2015).
  2. c4dmmd1Export to FBX
  3. c4dmmd2Now, open your blender. I use blender 2.76, yep it’s totally fine just use 2.72
  4. c4dmmd3If you had problem with built-in FBX importer, try use Experimental FBX as in 2.72, else, you have to copy experimental FBX from 2.72 to your blender addon folder, along with blender2pmx
  5. c4dmmd4from blender 2.72 folder, copy io_scene_fbx_experimental to your blender addon folder. Do the same with your blender2pmx.
  6. c4dmmd5After you installed both PMX and FBX plugin and turned it on, import your FBX by using Experimental FBX import. Also check automatic bone and manual orientation if you had problem with your model.
  7. c4dmmd6Select all by pressing CTRL + A and export to PMX
  8. c4dmmd7open your PMX Editor and open your PMX file
  9. c4dmmd8Well, now you got your own 3D Model on MMD. I don’t really know how to set up physics on PMX.
Follow

Get every new post delivered to your Inbox.

Join 547 other followers