Simple question

View previous topic View next topic Go down

Simple question

Post by TAG on Tue Mar 22, 2016 10:36 am

Hello  Very Happy
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? Smile
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

View user profile

Back to top Go down

Re: Simple question

Post by Dee on Tue Mar 22, 2016 3:07 pm

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?
avatar
Dee
Admin

Posts : 29
Join date : 2015-07-31

View user profile http://2deegameart.com

Back to top Go down

Re: Simple question

Post by TAG on Tue Mar 22, 2016 3:38 pm

Maybe the language barrier and my question is hard to understand due to the fact that English is not my native language Smile
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

View user profile

Back to top Go down

Re: Simple question

Post by Dee on Tue Mar 22, 2016 3:41 pm

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.
avatar
Dee
Admin

Posts : 29
Join date : 2015-07-31

View user profile http://2deegameart.com

Back to top Go down

Re: Simple question

Post by TAG on Wed Mar 23, 2016 3:26 pm

Thank you for trying to understand Very Happy
As soon as we solve our problems is we will present our project.

Take care

TAG

Posts : 3
Join date : 2016-03-22

View user profile

Back to top Go down

Re: Simple question

Post by redorav on Tue May 24, 2016 4:33 pm

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)

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

View user profile

Back to top Go down

Re: Simple question

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum