Simple question
3 posters
Page 1 of 1
Simple question
Hello
We are amateurs but we have set ourselves an ambitious project to complete.
We are working on a 2D fighting game, we use real actor`s sprites recorded in green screen studio.
Our fighting engine allows us to the use of firearms, knives and hand to hand combat.
Inevitably, we are not able to accommodate all the animation frames for character in one sprite sheet.
"Sprite DLight" works perfect on single sprite or sheet, but can somebody explain me how to integrate rest of the sprite sheets for character?
For example if we have a "idle" (fighting stance) and we want add normal maps to kick or walk animation sprite sheet.
We must assign the rest of the materials for other animation only by code?
We are working on Unity Engine.
I will be grateful for the help.
We are amateurs but we have set ourselves an ambitious project to complete.
We are working on a 2D fighting game, we use real actor`s sprites recorded in green screen studio.
Our fighting engine allows us to the use of firearms, knives and hand to hand combat.
Inevitably, we are not able to accommodate all the animation frames for character in one sprite sheet.
"Sprite DLight" works perfect on single sprite or sheet, but can somebody explain me how to integrate rest of the sprite sheets for character?
For example if we have a "idle" (fighting stance) and we want add normal maps to kick or walk animation sprite sheet.
We must assign the rest of the materials for other animation only by code?
We are working on Unity Engine.
I will be grateful for the help.
TAG- Posts : 3
Join date : 2016-03-22
Re: Simple question
Not sure if I understand the question correctly.
What's wrong with processing the sprite sequences or sprite sheets for each animation and assigning the normal maps to them inside Unity?
What's wrong with processing the sprite sequences or sprite sheets for each animation and assigning the normal maps to them inside Unity?
Re: Simple question
Maybe the language barrier and my question is hard to understand due to the fact that English is not my native language
The point is NOT that there is something wrong with processing sprites, just that I do not know exactly how to add material (with normal maps) by the script in Unity.
Forgive me, still learning;)
The point is NOT that there is something wrong with processing sprites, just that I do not know exactly how to add material (with normal maps) by the script in Unity.
Forgive me, still learning;)
TAG- Posts : 3
Join date : 2016-03-22
Re: Simple question
Okay, sorry for the misunderstanding.
Unfortunately, I cannot be of much help when it comes to Unity, but hopefully a more experienced user can shed some light onto this.
Unfortunately, I cannot be of much help when it comes to Unity, but hopefully a more experienced user can shed some light onto this.
Re: Simple question
Thank you for trying to understand
As soon as we solve our problems is we will present our project.
Take care
As soon as we solve our problems is we will present our project.
Take care
TAG- Posts : 3
Join date : 2016-03-22
Re: Simple question
I don't know if this will help you anymore, but we did it using 2D Toolkit and Unity. Basically, you need to create a shader that roughly looks like this:
First you define your properties, in this case a normal map sampler and an albedo sampler (make sure to mark the normal map in Unity as normal map in the texture type)
And then for a surface shader you need to read the normal map (make sure to unpack the normal) and then pass it to the surface output.
Hope it helps
First you define your properties, in this case a normal map sampler and an albedo sampler (make sure to mark the normal map in Unity as normal map in the texture type)
- Code:
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_NormalMap ("Normal Map (RGB)", 2D) = "white" {}
}
And then for a surface shader you need to read the normal map (make sure to unpack the normal) and then pass it to the surface output.
- Code:
SubShader
{
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
ZWrite Off Blend SrcAlpha OneMinusSrcAlpha Cull Off Fog { Mode Off }
LOD 110
CGPROGRAM
#pragma surface surf Lambert alpha
struct Input {
float2 uv_MainTex;
fixed4 color : COLOR;
};
sampler2D _MainTex;
sampler2D _NormalMap;
void surf(Input IN, inout SurfaceOutput o)
{
fixed4 mainColor = tex2D(_MainTex, IN.uv_MainTex) * IN.color;
o.Albedo = mainColor.rgb;
o.Normal = UnpackNormal(tex2D(_NormalMap, IN.uv_MainTex));
o.Alpha = mainColor.a;
}
ENDCG
}
Hope it helps
redorav- Posts : 2
Join date : 2015-12-19
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum