Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

bgs2k

Newbie
  • Content count

    10
  • Joined

  • Last visited

Community Reputation

0 Neutral

About bgs2k

  • Rank
    Newbie
  • Birthday 03/01/1999

Profile Information

  • Gender
    Male
  • Location:
    Romania
  1. Shader Problem

    The problem was unity, i reinstalled it and work perfecly fine. No clue what happend tho.
  2. Shader Problem

    here i calculate the final color between 2 point if t.a = 0 then final color is : color 1 * (1-0) + color 2 * 0 => color1; if t.a = 1 then final color is : color 1 * (1-1) + color 2 * 1 => color2; if t.a = anywhere between then final color is : color 1 * (1-x) + color 2 * x => new color 3 it doesnt matter if i have a zero i will still have a color, but i tried using half4 and then lerp ( color1, color2, based on color2.a) that basically does the same thing, but didnt work at all. btw i just looked on the build in shader that unity provide us on site, decal work with main texture = fixed4, decal texture = half4, and then recalculate main with lerp, so ..., i dont thing that mathematical is a problem
  3. Shader Problem

    Hello, so i wrote a shader that act like the legacy shader/decal but contains 3 texture : Shader "Exemple" { Properties { _Texture1 ("1st Texture", 2D) = "white" {} //Background Image _Texture2 ("2st Texture", 2D) = "white" {} //Middle Image _Texture3 ("3rd Texture", 2D) = "white" {} //Main Image } SubShader { tags { "RenderType"="Opaque"} LOD 300 CGPROGRAM #pragma surface surf Lambert sampler2D _Texture1; sampler2D _Texture2; sampler2D _Texture3; struct Input { float2 uv_Texture1; float2 uv_Texture2; float2 uv_Texture3; }; So here with say to our shader, "hey, i have for u 3 textures", Now let put 3rd texture on top of 2nd , and both an top of 1st void surf (Input IN, inout SurfaceOutput o) { // Lets take their color fixed4 t1 = tex2D (_Texture1, IN.uv_Texture1); fixed4 t2 = tex2D (_Texture2, IN.uv_Texture2); fixed4 t3 = tex2D (_Texture3, IN.uv_Texture3); //And now lets imagine a nice view, on top of every face of a cube. //The aqua blue sky image in the background //Then a nice fluffy cloud //And then a magical bird flying for no reaseon //A shiny view... //Now lets place 3rd texture on top of 2nd fixed4 c2 = t2.rgba * (1 - t3.a); fixed4 c3 = t3.rgba * t3.a; //So this will be like the the actor of the scene with some scenes decoration,the bird and the cloud fixed4 c23 = c2.rgba + c3.rgba; //Ok then let put our bird and cloud on top of our background fixed4 c1 = t1.rgba * (1 - c23.a); fixed4 c4 = c23.rgba * c23.a; //Now lets combine everything o.Albedo = c1.rgb + c4.rgb; o.Alpha = c1.a + c4.a; } ENDCG } Fallback "Legacy Shaders/Diffuse" } Ok, nice, very nice, but what its wrong, there's no texture on my cube :(. I have everything setup correctly. If its there any good souls that will help me again :D, please :), i'm tring to figure it out from yesterday, but maybe im not that smart, im giving up. No errors tho.
  4. Texture Gaps

    Thank you, this was very useful. Besides this, i changed the opacity of the texture, and it works perfectly
  5. Texture Gaps

    Although, i could make 1px larger every texture part, a just wandering id this its a 'float' imprecision of unity, and how can i solve it
  6. Texture Gaps

    Hello, in my game i use a very simple 3d style, just some cubes with pixel textures. But I keep getting this problem, gaps between faces. I go to blender, assign every face to a part of texture, using snap pixel option. I delete the unused part of texture, make it transparent. And finnaly, setup everything in unity, but my model keep geting this gaps from the texture. How can i solve it, i "Google" but what i find wasnt useful. Here its an example: http://imgur.com/WmLMilc Some models have bigger gaps, other model smaller ones
  7. DaBossTMR - FPS Kit (OPEN SOURCE)

    It's not really what i meant to ask. I think i saw this kit updated for u5 a few months ago, and now it's gone, just wondering why? @geckoo It's working, this kit its u5.3.3 + have some small errors, nothing too crazy
  8. DaBossTMR - FPS Kit (OPEN SOURCE)

    Was this kit removed from download section?
  9. Bullet collision

    Hello,in my bullet script this is how collision is detected: private float speed = 10; private LayerMask layer; private void Start() { Collider[] collisions = Physics.OverlapSphere (transform.position, .3f, layer); if (collisions.Length > 0) { OnCollision (collisions [0], transform.position); } } private void Update() { float moveDistance = Time.deltaTime * speed; transform.Translate (Vector3.forward * moveDistance); CheckCollisions (moveDistance); } private void CheckCollisions(float moveDistance) { Ray ray = new Ray (transform.position, transform.forward); RaycastHit hit; if (Physics.Raycast (ray, out hit, moveDistance, layer, QueryTriggerInteraction.Collide)) { OnCollision (hit.collider, hit.point); } } private void OnCollision(Collider hitObj,Vector3 hitPoint) { GameObject.Destroy (gameObject); } But the problem is that sometimes bullet can get through the any object and it get destroyed faster than when it hit anything. How can i correct that?
×