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.


  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About eco_bach

  • Rank

Profile Information

  • Gender
  • Location:
  1. Thanks much searching came across this example, with a tutorial as well https://bitbucket.org/jparham/blog-tic-tac-toe/src http://theliquidfire.com/2016/05/05/turn-based-multiplayer-part-1/ Would appreciate feedback!
  2. Hi Having a huge problem trying to simply implement a working framework for a turn based (each player takes turns) board game using UNET. I have an Eventmanager system I am comfortable with for sending, receiving custom events. I want to avoid adding any unnecessary complexity, so no State machine etc. Just a Model class A Game Controller Perhaps a controller for each player? And a View for the board and game pieces. Not sure whether most of the game logic (calculating score, wins etc.) would go in the Game Controller or Model class. Will extend this for use in AR. Can anyone help? Are there any really useful MVC C# templates that would get me started? Any help appreciated!
  3. Have a tricky issue applying a face texture to a dynamic mesh generated from a Kinect sensor. In the following 'myGameObjectReference' is passed in manually and avModelVertices, avModelUV, and avModelTriangles are all previously defined and contain correct data. The .png files that I am dynamically loading from my Resources folder are having some effect as can be seen from the attached images. But you can see in the 2nd example that the entire image is not being mapped correctly as a texture to the face mesh. Confused as to what is happening here. What seems to be happening is that the color values from the loaded png are averaged and then applied to the entire mesh. But Why? Can any texture experts help? Mesh mesh = new Mesh(); mesh.name = "FaceMesh"; myGameObjectReference.GetComponent<MeshFilter>().mesh = mesh; MeshRenderer rend = myGameObjectReference.GetComponent<MeshRenderer>(); rend.material.mainTexture = Resources.Load("faceTexture1") as Texture; mesh.vertices = avModelVertices; mesh.uv = avModelUV; mesh.triangles = avModelTriangles; mesh.RecalculateNormals();
  4. Are there any experienced MODO and Maya peeps reading this that could list what advantages, if any, a Maya to Unity workflow would have over a MODO to Unity workflow? I know Maya is more of an Industry standard but I've purchased MODO because of 1 its modelling abilities, 2 price, 3 less steep learning curve.
  5. Hi Using MODO to do all my modelling. MODO has some pretty powerful duplication and alignment options for meshes. When I export and then import my FBX into Unity I would like some way to covert all these duplicates to Prefabs, so that in Unity I would only need to edit one item. Was wondering if using the AssetPostprocessor functionality might be one way. http://docs.unity3d.com/ScriptReference/AssetPostprocessor.html I'm sure this is a pretty common request. Anyone know of a solution?
  6. I have the following shader which supports a single texture plus lighting. I've been trying to get it working with a second texture (2 sided quad)without luck. In previous tests I was able to determine which side was facing the camera by using the VFACE Semantic in the pixel shader constructor. float4 frag(vertexOutput i, float facing : VFACE) : COLOR and then simply checking if facing was greater than or < zero. But doesn't seem to work for me here. Any shader gurus that can possibly help? Shader "custom/one sided plus lighting"{ Properties { _Color ("Color Tint", Color) = (1.0,1.0,1.0,1.0) _MainTex ("Diffuse Texture", 2D) = "white" {} _SpecColor ("Specular Color", Color) = (1.0,1.0,1.0,1.0) _Shininess ("Shininess", Float) = 10 } SubShader { Pass { Tags {"LightMode" = "ForwardBase"} CGPROGRAM #pragma vertex vert #pragma fragment frag #pragma exclude_renderers flash //user defined variables uniform sampler2D _MainTex; uniform float4 _MainTex_ST; uniform float4 _Color; uniform float4 _SpecColor; uniform float4 _RimColor; uniform float _Shininess; uniform float _RimPower; //unity defined variables uniform float4 _LightColor0; //base input structs struct vertexInput{ float4 vertex : POSITION; float3 normal : NORMAL; float4 texcoord : TEXCOORD0; }; struct vertexOutput{ float4 pos : SV_POSITION; float4 tex : TEXCOORD0; float4 posWorld : TEXCOORD1; float3 normalDir : TEXCOORD2; }; //vertex Function vertexOutput vert(vertexInput v){ vertexOutput o; o.posWorld = mul(_Object2World, v.vertex); o.normalDir = normalize( mul( float4( v.normal, 0.0 ), _World2Object ).xyz ); o.pos = mul(UNITY_MATRIX_MVP, v.vertex); o.tex = v.texcoord; return o; } //fragment function float4 frag(vertexOutput i) : COLOR { float3 normalDirection = i.normalDir; float3 viewDirection = normalize( _WorldSpaceCameraPos.xyz - i.posWorld.xyz ); float3 lightDirection; float atten; if(_WorldSpaceLightPos0.w == 0.0){ //directional light atten = 1.0; lightDirection = normalize(_WorldSpaceLightPos0.xyz); } else{ float3 fragmentToLightSource = _WorldSpaceLightPos0.xyz - i.posWorld.xyz; float distance = length(fragmentToLightSource); atten = 1.0/distance; lightDirection = normalize(fragmentToLightSource); } //Lighting float3 diffuseReflection = atten * _LightColor0.xyz * saturate(dot(normalDirection, lightDirection)); float3 specularReflection = diffuseReflection * _SpecColor.xyz * pow(saturate(dot(reflect(-lightDirection, normalDirection), viewDirection)) , _Shininess); float3 lightFinal = UNITY_LIGHTMODEL_AMBIENT.xyz + diffuseReflection + specularReflection;// + rimLighting; //Texture Maps float4 tex = tex2D(_MainTex, i.tex.xy * _MainTex_ST.xy + _MainTex_ST.zw); return float4(tex.xyz * lightFinal * _Color.xyz, 1.0); } ENDCG } } //Fallback "Specular" }
  7. I have a working Vertex Fragment shader that allows 2 textures for the front and back of a mesh(Quad). The problem is that it doesn't react to lighting. I have another very simple Surface shader that reacts to diffuse lighting. So how do I combine the 2? In my Vertex Fragment shader I am using the VFACE semantic as an additional argument in my Fragment or Pixel shader function to check which side is currently facing the camera.
  8. Trying to explore ways of possibly controlling a puppet or avatar using webcam input only, no kinect or similar sensor. Is anyone aware of a way of doing this in Unity?
  9. I need to store the brightness or grayscale values of a 32 pixel wide x 18 pixel tall webcamTexture in an array. A 2D array would seem the logical choice but I've read that jagged arrays are faster. In the following I've declared my jagged array as follows float[][] greyscaleVals = new float[18][]; and texture represents a Texture2D populated with pixels from a ReadPixels call in my OnRenderImage method. My question is, am I populating my jagged array properly? Not that I am decrementing in the outer loop since x,y coordinates in a Texture2D start in the lower left. void OnPostRender(){ for (int i = 17; i>=0; i--) { greyscaleVals = new float [32]; // Create inner array for (int j = 0; j < 32; j++) greyscaleVals[j] = texture.GetPixel(j+1,i+1).grayscale; } }
  10. I am trying to apply a pixelate shader effect to a webcamTexture and then obtain the brightness values of each pixelated 'cell' in realtime. That is my goal! So far have sourced this pixelate shader effect here> http://forum.unity3d.com/threads/183210-Making-a-local-pixelation-image-effect-shader?p=1252552&viewfull=1#post1252552 It works by applying it to a quad that sits between your camera and the actual webcamTexture(on another quad). Can any shader experts tell me if I could simplify things by attaching this shader directly to the camera via a script and accessing via OnRenderImage() ?
  11. Hi I have an application that samples RGB values from a texture2D object which I then need to convert to brightness values and send to another part of the application. Which option would be fastest for storing, updating these values(which I also need to access sequentially in real time as well), Array, LinkedList or ArrayList?
  12. I have a standalone application with a quad that I want to keep at a fixed size. Unfortunately it scales when the window is resized. Ho do I prevent this?
  13. I meant good 3rd party reviews independent from the asset store
  14. Can anyone recommend a blog, podcast, or other source for good reviews of games available in the asset store?
  • Create New...