imagination XD

realizing dream


3 Comments

[Tutorial] IES Light on Unity

Without IES Light

Without IES Light

IES Light on Unity

IES Light on Unity

Back then, I thought IES light was useless, but when I’m making an interior scene for my Animation I notice a weirdness on ceiling lights. It was circle!!! There’s no circle shaped ceiling lights (except lightbulb)!

You’ll gonna need

    • IESviewer 2.9
    • Prtscr (Optional, if you don’t want to use MSPaint)
    • And IES / LDT light of course!

And this is how

  1. iesUnity2
  2. Go to IES Viewer and right click on your IES or LDR light and then click Render, or simply just press CTRL+R. Sometimes, the Render window just wont show, just delete .ini file and reopen IESViewer.
  3. iesUnity3
  4. Adjust brightness, Zoom, and Distance until you pleased with the result then press Prt Scn / Print Screen on your keyboard. If you don’t have PrtScr, then you’ll need to open MSPaint (Press Winkey + R and type MSPaint). If you have PrtScr, hold CTRL and left click the render window and it’ll automatically crop it.
  5. iesUnity4
  6. Paste (CTRL+V) on MSPaint and then crop the pasted clipboard like this. Save it as JPG or PNG.
  7. IESsssThis is my IES Light
  8. IESUnity5Now go to Unity and import your IES light. Set texture type as Cookie, Light type as Point, Mapping : Mirrored Ball, Glossy Reflection, Fixup Edge Seams, Alpha from Grayscale (IMPORTANT!), and filter mode to Trilinear.
  9. IESUnity6Go to Game Object > Light > Point Light, and assign your IES file to Cookie texture.
  10. IESUnity7
  11. Now look! IES Light on Unity! Although it’s not important, but it’ll make scene looks more realistic than a nonsense circle light.


9 Comments

[Unity] Blendshape Eye Controller (Look At, Random Eyes, and Random Blink)

 

2019 UPDATE

I’ve noticed that Mediafire deleted the original script. Please use this script instead. This script is from my game (Project IMG). I’m sorry if there’s any error happened. This is more updated version and it’s C#

https://drive.google.com/open?id=1uIVj-o5HvuuEr6_oHDRl1Or9umX1Vl9k

Controlling eyes with Unity’s blendshape controller is difficult especially Unity likes to make a blendshape is a float value which harder to control and you can’t even control any movement like down or left. The picture above represents the movement of their eyes. See closely with that cyclops, her eyes were move following that ball, meanwhile the penguin just stuttered with the eye (Random Eye and blink).

You’re gonna need 4 / 5 basic eye blendshapes like Up eye, Right eye, Down eye, Left eye, and blink (optional).

pxeyes nyeyes pyeyes nxeyes

This is very useful tool especially for wannabe animator like me.

Download the script here,

Tutorial

  1. blendeye2
  2. Add this script on the root of your character.
  3. blendeye3
  4. blendeye2aAssign the number / ID of your Blendshape as in your blendshape mesh. I added isDebugging mode, that’ll ease you out finding the number of the blendshape.

  5. blendeye4
  6. After found the right ID, now you’re done! You can control eye movement via 2D Target now. But is that enough ? LOL NOPE!
    blendeye5
  7. To make it focus in 3D Way, create an empty game object and set it as target.
  8. blendeye6
  9. Sometimes this might happens (A certain eye moves in reverse way), to fix it, just invert the blendshape ID like Positive X Axis was 0 and set it to 1 and Negative X Axis was 1 and set it to 0.
    blendeye7
  10. Now look! Your character will focus on that object forever! But if that’s not please you enough, you can use Random Eyes mover (I forgot to make it move along with your target, so it’ll move along with the center of your head). But if you really do want random movement along your target, then just remove “target” line below randomizer target transform.
  11. if(!randomizerTarget){
     randomizerTarget = new GameObject("RNDTRG");
     randomizerTarget.transform.position = blendshapeEyeMesh.transform.position;
     target = randomizerTarget.transform; // remove this
     }else{
     target.position += Random.onUnitSphere * Time.fixedDeltaTime/randomCompressor;
     }
  12. And so do you want them blink ? just turn on Blinkable and your character will be blinkable. The higher value of blink speed the faster it’ll be. And what is Target Multiplier ? That’s just speed multiplier of your 3D target, how fast / sensitive their eye will follow your 3D target.


Leave a comment

[Shader] Reflective Transparent / Water-like Unity Indie

This is what I promised. Sorry for being late, I’m kinda busy recently. I made this shader by merging between Transparent>Diffuse and Reflective>Diffuse. But I haven’t done with Normal Mapped Specular. My Unity kinda hates me, everytime I add Normal Map to this shader Unity Yells “Too many texture interpolators would be used for ForwardBase pass!” or “_ReflectColor no Properties!”. Perhaps you can do it yourself.

NOTE : I didn’t copy this script from internet. I just merge Unity’s Transparent>Diffuse and Reflective>Diffuse. So, if you are saying that I copy your script like that movie script I was made in 2012 and you found in 2014, go f*** yourself… By the way, this script ALREADY Exist on Nitro Racer XD on Epic Living Room track. I just made a lot of modification from Nitro Racer XD.

Shader name in Unity is “Glass Reflective_N”, and this is the preview / how to use the shader.

Ref_BLWater Ref_Full Ref_BLRef Ref_MStUnity - Untitled - RT - PC, Mac & Linux Standalone_4

Want More Realistic ?

If you want more realistic, you could add UVMover (Moving main texture’s offset from script * Time.deltaTime), and Realtime Reflection INDIE. Adding some Caustic effects or Underwater effects or Normal Map or Specular Shininess. You can also use this shader for a glass…

Glass Reflective_N

Shader name is a little bit ironic isn’t it ? It says N for Normal Map support, but this shader couldn’t support Normal Map. Alright here’s the shader.

Shader "Glass Reflective_N" {
 Properties {
 _Color ("Main Color", Color) = (0.5,0.5,0.5,1)
 _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5)
 //_Shininess ("Shininess", Range (0.01, 1)) = 0.078125
 _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {}
 //_BumpMap ("Normalmap", 2D) = "bump" {}
 _Cube ("Reflection Cubemap", Cube) = "black" { TexGen CubeReflect }
 }
 SubShader {
 Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
 Blend SrcAlpha OneMinusSrcAlpha
 //Pass {
 // Color [_Color]
 // SetTexture [_MainTex] {
 // combine texture * primary
 // }
 // }
 LOD 300
 
 CGPROGRAM
 //#pragma surface surf BlinnPhong decal:add nolightmap
 #pragma surface surf BlinnPhong alpha
 //#pragma target 3.0
 sampler2D _MainTex;
 //sampler2D _BumpMap;
 samplerCUBE _Cube;
 //half _Shininess;
 
 fixed4 _ReflectColor;
 fixed4 _Color;
 
 struct Input {
 float3 worldRefl;
 float2 uv_MainTex;
 //float2 uv_BumpMap;
 INTERNAL_DATA
 };
 
 void surf (Input IN, inout SurfaceOutput o) {
 fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
 //o.Albedo = 1;
 //o.Gloss = 0;
 o.Albedo = tex.rgb * _Color.rgb;
 o.Gloss = tex.a;
 //o.Normal = UnpackNormal (tex2D (_BumpMap, IN.uv_BumpMap));
 
 //o.Specular = _Shininess;
 float3 worldRefl = WorldReflectionVector (IN, o.Normal);
 fixed4 reflcol = texCUBE (_Cube, IN.worldRefl);
 reflcol *= tex.a;
 o.Emission = reflcol.rgb * _ReflectColor.rgb;
 //o.Alpha = reflcol.a * _ReflectColor.a;
 o.Alpha = tex.a * _Color.a;
 
 }
 ENDCG
 }
 FallBack "Transparent/VertexLit"
}

 


9 Comments

[TUTORIAL] REALTIME Reflection on Unity Indie

I really amazed when I found this trick. I know that Unity INDIE could make a realtime reflection via CAMERA.RENDERCUBEMAP. However, there still has some limitations like not really slow, and only 64 pixels. If you set the update rate to 0.03, it’ll slow as hell (about 14 fps), and if you set the update rate to 1, it’s not slow (about 60 fps).

And this is the tutorial :

  1. Go make a new javascript. The code are in the below of this post.
  2. Go make a new Cubemap by clicking CREATE > CUBEMAP on project tab.
  3. I named it “CUBOMAPO_REF”;
  4. Assign this script on an object that you want to enable the reflection.
  5. Assign CUBOMAPO_REF or your cubemap to CUBEMAP properties in your Reflective Object.
  6. Assign YOUR CURRENT MATERIAL to CURRENT MATERIAL properties in your reflective object.
  7. meshos
  8. Adjust the update rate.
  9. DONE! Now look what have you done! This is my preview…. With 0.2 Update Rate about 40 fps.

Realtime Reflection

This is the code

#pragma strict

var cubemap : Cubemap;
var currentMaterial : Material;
var updateRate = 1.0;
private var renderFromPosition : Transform;
private var minz = -1.0;

function Start () {
    renderFromPosition = transform;
}

function Update () {
    if(Time.time - updateRate > minz){
        minz = Time.time - Time.deltaTime;
        RenderMe();
        currentMaterial.SetTexture("_Cube",cubemap);
        renderer.material = currentMaterial;
    }
}

function RenderMe(){
    var go = new GameObject( "CubemapCamera"+Random.seed, Camera );
        
    go.camera.backgroundColor = Color.black;
    go.camera.cullingMask = ~(1<<8);
    go.transform.position = renderFromPosition.position;
    if(renderFromPosition.renderer )go.transform.position = renderFromPosition.renderer.bounds.center;
    go.transform.rotation = Quaternion.identity;
    
    go.camera.RenderToCubemap( cubemap );

    DestroyImmediate( go );
}


Leave a comment

Advertise Yourself [Nitro Racer XD]

So, I’m still thinking to add some random advertising in Tribunes or in Billboard. I still have 5 free slots for both of them.

Tribunes Ads

Unity - sft_td.unity - NitroRacerXD - PC, Mac & Linux StandaloneSo, It’ll be like this. Price ? Free… The texture size will be 512×512.

Free slots

  • EMPTY
  • EMPTY
  • EMPTY
  • EMPTY
  • EMPTY

Billboard Ads

fakeBakedShadowPrice ? Same… Free. Come on, quick before i change my mind. The billboard texture size will be 512×512.

Free slots

  • Empty
  • Empty
  • Empty
  • Empty
  • Empty

If you interested, please send your request on this form below, and send your ads images to my email vmon2010@hotmail.com


Leave a comment

[Update] Shooting Star 2 (2013) Android & PC

I’ve updated since January 3, 2012. But my internet is too slow to post it here. I haven’t uploaded PC Version of Shooting Star 2. But i already uploaded Shooting Star 2 Android version.

Download here (Android)

Shooting Star 2 Setup (2013) Download here (PC)

Changes on Shooting Star 2 PC

  1. Brigadier bug on Mouse Orbit Fixed
  2. Fixed Camera bug fixed

Changes on Shooting Star 2 Android

  1. Brigadier bug on Mouse Orbit Fixed
  2. Set Active Recursively optimization mode
  3. Far clip plane set to 300 earlier has 1000 which make it very very slow

Sorry i can’t fix the relative control things.