• Unity3D - Discussion
    5,004 replies, posted
I can't seem to find why this happens, any takers? [img]http://i.imgur.com/pGK3rOx.jpg?1[/img] (The material is not drawing onto the object entirely, the texture actually does look like that; for now.) [b]Solved:[/b] The smaller the mipMapBias the more of a larger resolution texture can be seen from greater distances. Performance doesn't seem to be hindered too much with a -4 bias (-0.5 is the recommended).
[QUOTE=Pelf;45770055]It really only starts becoming a problem when >10,000m from the origin (that's when you lose millimeter precision). How big of a driving game are you making? If it's smaller than 20km x 20km then you can just move the player in space.[/QUOTE] The goal is procedural generation of a single road. I tried it once before where the road and the player didn't move but the road had an armature that would animate. In the end though it became too much of a hassle trying to create fake physics while using real physics.
I have such a hardon for the new UI system, it does everything you'd want a UI system to do. I made a functional chatbox in not much time at all. I don't really see a need for thirdparty UI systems now that we have this. Although I'll probably hate it once it can't do something I need it to do. Good job it's open source!
Well, I haven't been using the new GUI systems everyone's playing with. Instead, I've been working on PERKS. [video=youtube;QFOG4ILfbJQ]http://www.youtube.com/watch?v=QFOG4ILfbJQ&list=UUlSdAOcN_dStix9yQkKXmsQ[/video] Rather a simple system really, in essence it's just a modified version of the item system (meaning that items could potentially give you buffs). There's only one perk I've worked on right now, which is (as you may be able to tell in the video) teleportation (that hurts you when you use it, so do be careful). More perks can be unlocked during the game, but there'll be some to start with so that the player has some toys they can use. This should make the start of the game less boring, as the player will have a small amount of power to use. Haven't done enough for a changelog yet, maybe next time. OH, and I've been convinced to put this on Steam Greenlight in the near future. I'm going to make some not-crap GUI for it and knuckle down to make a demo (mainly adding a sort of introduction and a load of buildings with exciting stuff in them HOW FUN).
Still working on the deferred renderer. [video=dailymotion;x24c8eb]http://www.dailymotion.com/video/x24c8eb_unity-deferred-renderer-3_videogames[/video] - Added cascaded shadow maps - Added first person mesh support. Uses a hack where I essentially "squash" the z position of the weapon's vertices AFTER projection, in the shader, so as to not clip into world geometry and render properly into the G-Buffer. This is similar to an approach taken by Epic in UE3 (and Gearbox - there was a forum post somewhere where a Gearbox employee talked about when they updated their UE3 codebase and found that technique used in the updated code) - Added support for a forward rendering pass. The un-shadowed sphere in the video is rendered in forward mode (which is why it doesn't receive shadows) There's some situations where shadows don't look quite right on the first person mesh. However, in these situations there's really nothing that [I]would[/I] look correct (just look wrong in a different way). EDIT: Also, follow the video link and download the source video for 60FPS - trust me, it looks WAY better at 60FPS.
I'm trying the new GUI system but I've got a problem; I click on a button, then every time after that, if I press Space, it clicks the button again. How do I make it so I can press space without clicking the button?
Added normal mapping to my deferred renderer. Tangent space normal mapping makes my brain hurt. [vid]https://dl.dropboxusercontent.com/u/99106620/Deferred4.webm[/vid] [I]Still experimenting with video formats. It's kinda low quality because I had to compress it down in order for the WebM conversion to not take absolutely ages to complete, but hey it's 60FPS[/I] EDIT: How on earth do I embed Webm videos?? EDIT2: Thanks :)
[vid ] tag for embedding webm, mp4, etc.
I miss seeing that Bolt fps you were working on, Maaki :v:
[QUOTE=sarge997;45778422]I miss seeing that Bolt fps you were working on, Maaki :v:[/QUOTE] Hey, I'll get back to that soon enough :) I'm actually getting ready to pass this deferred renderer off to Laberstram on the Unity forums as we've been talking about him porting Lux over to it. The idea is to use this for the game's rendering engine rather than Unity's deferred rendering, as there's a number of improvements this one has (for instance, better image effect integration as I can plug custom image effects anywhere in the pipeline - after gbuffers are written, after lighting is performed, or after the whole frame is rendered; the fact that my custom deferred renderer directly supports first person meshes including allowing them to receive shadows; and several other improvements)
For anyone using bolt, how do you get around the fact that bolt has no networked IDs for entities or connections? It's a very important part of networking and he just decided to leave it out? Are we expected to give an ID to every entity ourself and network it? It makes even simple things like a player chat almost impossible to do. Usually you would send the ID of the player that sent the message so you can grab their name and whatever else you want to display in chat. Without an ID to identify where the chat came from you'd have to send their player name in the chat event. Thought I'd ask here because their forums aren't very active. I'm not going to call bolt shit until I know for sure I'm not missing something important but every time I try and do something with bolt, there's a limitation that stops me from doing it.
Well, you can pass BoltEntity as a parameter to an event. Don't think you can send BoltConnections though, as clients don't keep track of other players (they only have one BoltConnection, and that's the connection to the server). What I did was create my own system for keeping track of players, via a PlayerInfo class, with a custom ID system (when a client joins, the server first sends them a list of all current PlayerInfos, and then sends that client's new PlayerInfo to other clients). [editline]23rd August 2014[/editline] I'm facing an interesting problem in my deferred renderer. Trying to implement lightmapping. So, assuming there's two kinds of lights: - Static lights, which are used for lightmapping and should NOT move - Dynamic lights, which are not used for lightmapping and are allowed to move Static lights should not affect lightmapped surfaces, as those surfaces already bake the contribution from that light. However, dynamic lights should affect both lightmapped surfaces and dynamic surfaces. And, of course, none of this information is available in the G-buffer. I do have one channel of my lighting buffer which currently acts as a "light mask", used to mask out the sky so that lights do not affect areas of the buffer which are background skybox. What I had thought to do was change it so that the value in this channel encodes what surface type a pixel is - 0 if sky, 0.5 if lightmapped, and 1 if dynamic. This however leads to a per-pixel branch. If I wanted to avoid that branch, I'd need yet another render texture, making my g-buffer even fatter (and in fact I'd exceed the four render buffer limit, meaning a whole separate render pass). I may be able to get rid of the pass by using the step function and basically evaluating and combining each branch together, although I don't know if that would be more or less efficient. I also don't know if I'm just overthinking it and whether I need to worry about the branch at all.
What exactly does sending an entity send though? You wouldn't want it to send a copy of the entity on the server. I'd hope it would just be a reference to the proxy entity but I highly doubt it works that way.
[QUOTE=layla;45779232]What exactly does sending an entity send though? You wouldn't want it to send a copy of the entity on the server. I'd hope it would just be a reference to the proxy entity but I highly doubt it works that way.[/QUOTE] That is how it seems to work. If you pass for example a player entity to an event, on the server the entity appears to refer to the appropriate player entity. I assume it passes some sort of internal entity ID.
Just wanna add this in. The developer has already stated that adding ID management and what not is on their To-Do list. Hopefully won't take long.
Getting myself familiar with the new Unity GUI tools. I basically ignored all HUD work on my game because I was going to redo it all when this stuff came out. For practice, I decided to try and recreate an Ace Combat style HUD. I just finished the heading tape and the pitch ladder should be pretty simple, but I'm not sure how to do the flight path marker. With the old system, it was actually pretty simple (well, the math part of it anyway), but with the way canvases work I'm kind of stumped with how to approach it. A bit unrelated, but is there an Imgur like place to upload webms? My dropbox is getting pretty cluttered with webms. [vid]https://dl.dropboxusercontent.com/u/15133164/UnityGeneral/Unity%202014-08-23%2016-03-37-63.webm[/vid]
Glad to see other people are working with BoltEngine. I was speaking with the creator and he fully intends to expand to other platforms so I'm pretty excited about that, he's a good guy and he's really working his ass off to make things better for anyone working with networking. Has anyone tried the new cloud build feature? I'm trying to figure out whether it's a git/svn host replacement or not. My Unity Pro serial key says it's already in use so I can't check it out myself. Also my shadows look like shit due to the dynamic weather system I'm using. Any advice on how to fix that? Because at this point, I might just take shadows out due to the performance hit and how bad it looks. How do you guys feel about shadows in games? I feel like they're rarely ever done right and unless they are, they might as well be out.
[QUOTE=layla;45779232]What exactly does sending an entity send though? You wouldn't want it to send a copy of the entity on the server. I'd hope it would just be a reference to the proxy entity but I highly doubt it works that way.[/QUOTE] The developer of bolt has already added this functionality. Each entity has a unique id now, and entities can be found from their unique id too using new methods. [url]http://github.com/BoltEngine/bolt[/url] if you have Git access (you can request this on the forums).
Well that's good news. I'll have to ask for access, I'm still using the old version on the asset store.
Dem specular highlights, man. [vid]https://dl.dropboxusercontent.com/u/99106620/Deferred5.webm[/vid] I had to make a fairly big change to get this to work properly. Previously, I had a Light Prepass style Light Accumulation Buffer where I would accumulate lighting results and then later combine that with the Albedo part of the GBuffer. The light buffer was rendered like so: - Initialize with ambient color - Render lighting for each light and add to buffer - Multiply with albedo Well, this doesn't work well for specular highlights, since they must be added separately rather than multiplied. So now I'm actually getting rid of that last step and doing this: - Initialize with ambient color * albedo - Render lighting for each light and add to buffer (diffuse * albedo + specular) So the final frame is just the results of the lighting calculation. This has some big benefits, particularly that I am not limited to monochrome specular anymore unlike the builtin deferred shading (since Unity uses light accumulation buffer, specular has to be kept separate from diffuse and diffuse has to be stored as RGB, leaving only one monochrome channel for specular). Also, alpha channel now contains either 0 for sky or 1 for surface, and I put whether a surface was dynamic or lightmapped in an unused channel of another render buffer (0 if dynamic, 1 if lightmapped, or something in between for a near/far lightmap fade). This allows me to get rid of the branching completely, which makes me feel better.
I figured out the flight path marker stuff, made a pitch ladder, and got a target box working. I'm really happy with how much like a real game this looks after just half a day's work. [vid]https://dl.dropboxusercontent.com/u/15133164/UnityGeneral/Unity%202014-08-23%2021-06-27-70.webm[/vid]
Hey, does anybody know if I can create a shader macro which expands into a function? like define a macro which expands into something like this: [code] float4 frag_LB(gbuffer_pixel pixelData, DeferredSurfaceOutput s) { #ifdef LIGHTMAP_ON float4 far = float4( DecodeLightmap( tex2D( unity_Lightmap, pixelData.lightmapUV ) ).rgb, 1 ); float4 near = float4( DecodeLightmap( tex2D( unity_LightmapInd, pixelData.lightmapUV ) ).rgb, 1 ); float fade = pow( pixelData.scrPos.z / _ShadowDistance, 8 ); float4 ret = lerp( near, far, clamp( fade, 0, 1 ) ); return ret * s.Albedo; #else return float4( frag_ambient( pixelData ) * s.Albedo, 1 ); #endif } [/code] I'm trying to make shader extensions to my deferred renderer easier to write, and it would be nice if I could just do something like this: [code] gbuffer_v2f vert(appdata_full v) { GBUFFER_INIT_VERT( v ) } DeferredSurfaceOutput surf(v2f pixelData) { DeferredSurfaceOutput o; float4 albedoTex = tex2D(_Albedo, pixelData.uv); float4 surfaceTex = tex2D(_Surface, pixelData.uv); o.Albedo = albedoTex.rgb; o.Normal = UnpackNormal( tex2D(_Normals, pixelData.uv)); o.SSS = albedoTex.a; o.Metalness = surfaceTex.r; o.Roughness = surfaceTex.g; return o; } PixelOutput fragTestMRT(gbuffer_pixel pixelData) { GBUFFER_OUTPUT_PIXEL( pixelData ) } [/code]
-snip- Never mind that was kind of dumb.
Last one for the day. 3D, physical HUDs. It’s pretty buggy because I basically just dropped it in without adjusting anything that needs adjusting, but as a proof of concept I’m very happy with the way this looks. HUDs that aren’t just projected onto the camera itself are the best, and with Oculus Rift it’s even more important than ever to have your HUDs be real things in your world. I’ll probably leave the “finished product” in screen space, but if I was to build a HUD with it being projected in mind, (and with a lot of time spent doing the art) I’m fully confident that it could look as good as the 3D DCS HUDs. [vid]https://dl.dropboxusercontent.com/u/15133164/UnityGeneral/Unity%202014-08-24%2000-39-19-23.webm[/vid]
How does Unity recognize sprites in a sprite sheet?
Anyone got any idea on how to get rid of PHONE_READ_STATE, that bastard permission keeps getting added back
[QUOTE=LuaChobo;45784744]There is a tool that lets you create your own sprite table/object/whatever from a spritesheet its really quite good[/QUOTE] To be exact, Select your sprite in the library, set the Sprite Mode to multiple, then click on the Sprite Editor button. In the new window that opens, select Slice in the top left corner. Set the type to something (probably grid), do the settings until it's good. Apply, and then you can click on the arrow next to the sprite to see every part individually like this [img]http://i.imgur.com/8kG8Spv.png[/img] If you select all the parts and drag them on the scene, it prompts you to create an animation btw :p
[QUOTE=Xerios3;45784754]Anyone got any idea on how to get rid of PHONE_READ_STATE, that bastard permission keeps getting added back[/QUOTE] Most commonly used to read the SystemInfo unique ID. It's Unity's way of having a unique identifier for each player.
Can't I just get the android id without using the phone_read_state permission? Some people are avoiding my game due to that scary "Device ID & Call information" message
[QUOTE=Xerios3;45787340]Can't I just get the android id without using the phone_read_state permission? Some people are avoiding my game due to that scary "Device ID & Call information" message[/QUOTE] Is your game out already?
Sorry, you need to Log In to post a reply to this thread.