Jump to content

Search the Community

Showing results for tags 'unity3d'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Community
    • News
    • Conversation
    • Compliment Box
    • Game Jams
    • Job Board
    • Your Games
    • Your Services
  • The Toolkit - Our Tools
    • AI GameDev Toolkit
    • Ambient Sounds
    • Gaia & Gaia Pro 2021
    • GeNa Pro
    • GTS - Glyph Terrain Shader
    • Pegasus
    • Scene Optimizer
    • Sectr Complete
    • HDRP Time Of Day
  • Packs - Procedural Content Packs
    • BEPR - Big Environment Pack Reforged
    • Fields of Colour
    • POLYGON Fantasy Kingdom
    • POLYGON Nature
    • SUNTAIL Stylized Fantasy Village
  • The xChange - You decide what we make ! (Subscribers Only)
    • Priority Requests
    • General Requests
    • Coming Soon - Playtime
    • Asset Integrations
    • Early Access
    • Game Templates
    • Game Ready Levels
    • Procedural Content Packs
    • Stamp Packs
    • Texture Packs
    • Utilities
  • Learning
    • Art
    • Level Design
    • Lighting
    • Marketing
    • Programming
    • Postmortems
    • Story Telling & Narrative
    • Unity

Blogs

  • Lets build worlds together

Categories

  • General
    • FAQ
    • Getting Started
  • Content Packs
    • Asset Packs
    • Game Ready Levels
    • Game Templates
    • Micro Biomes - Fields of Color
    • Nature - Spawner Pack for "POLYGON Nature"
    • Fantasy Kingdom - Spawner Pack for "POLYGON Fantasy Kingdom"
    • Fantasy Village - Spawner Pack for "SUNTAIL Fantasy Village"
    • BEPR - Spawner Pack for "Big Environment Pack Reforged"
  • Tools
    • Ambient Sounds
    • Gaia / Gaia Pro
    • GeNa Pro
    • GTS - Glyph Terrain Shader
    • HDRP Time of Day
    • Pegasus
    • Scene Optimizer
    • Sectr Complete 2019
    • Utilities
  • Deep Dives
    • Lighting
    • Maths
    • Performance
  • Early Access

Categories

  • AI GameDev Toolkit
    • Downloads
  • Beginner Downloads
    • Entry Level Tools
  • Professional Tool Downloads
    • Professional Tools
    • Procedural Content Packs
  • We Make For You Downloads
    • Early Access
    • Game Ready Levels & Templates
    • Stamp & Texture Packs
    • Tools & Utilities
  • Free Customer Downloads
    • Gaia Bonuses
    • GeNa Pro Bonuses

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 3 results

  1. I have just imported Pegasus to Unity v2019.3.6f1 and I cannot make the Fly camera for the Pegasus Capture to move during gameplay. I watched several videos and tried multiple key combinations, but I can only control the camera position and rotation manually in the Scene tab while playing, instead of the Game tab using the ASDW + Shift + Mouse keys. Am I doing something stupidly wrong?
  2. Isaac

    Why Unpack Normals in Unity3D?

    When writing shaders, you’ve probably come across the function in shader code ‘UnpackNormal’, which can be seen in use here: Float3 normal = UnpackNormal (tex2D(_Bump, _IN.uv_BumpMap)); Or in shadergraph, if you are using a normal texture without setting the texture import type as normal, you may have come across this node: Or, in the case of setting the normal map texture to be imported as such, the Sample Texture 2D performs this function itself: But why is it needed? Let’s start by looking at the space in these normal maps are made for, Tangent Space. Tangent Space You’ve probably heard of spaces before with names like WorldSpace, ObjectSpace, ViewSpace, ScreenSpace, ClipSpace, etc. Tangent Space is another one of these spaces. We can think of tangent space as a relative axis conforming to the normal of a surface, where the Z component matches the surface normal’s direction. The X and Y components can be thought of as describing how much the surface normal deviates from its original direction. The X and Y component are also referred to as the Tangent and BiNormal (sometimes also called BiTangent). The normal of the vertex is colored purple, whilst the tangent space aligned axis has the Z component aligned with the normal. You may have seen the coordinate (0,0,1) used as a default tangent space normal, and the Z component being 1 makes it align with the normal exactly. Our Tangent Space normal maps can only store positive values, whether it be from the range 0 - 1 or 0 – 255 (we will stick with the 0-1 range). Which means, without performing any type of conversion, the minimum vector we could store would be (0,0,1) and the maximum would be (1,1,1) (ignoring the Z component in this example), which would look like it can only deviate a max of one quadrant area from the surface normal. We don’t just want the normal to deviate in this single quadrant though, we want a full range of coordinates around the normal. Since our textures that store the tangent space normal vectors can only store positive values, but we want to also store negative values too, we need a way of remapping a negative to positive range into the positive range. Instead of performing a Remap() function, where we might pass in the negative to positive normal vector and get it remapped into a positive range, the math we use is a lot simpler than a Remap() function, since that uses a divide. To convert our Tangent Normal Vector into a range that a texture can hold, we take the X and Y components and multiply them by 0.5, then add 0.5. See it expressed below: Normal.xy = normal.xy * 0.5 + 0.5; Let’s look at an example with a negative value: · Tangent Normal Vector (-0.2, 0.3, 1): · Normal.xy = (-0.2, 0.3) * 0.5 + 0.5 · Normal.xy = (-0.2 * 0.5 + 0.5, 0.3 * 0.5 + 0.5) · Normal.xy = (-0.1 + 0.5, 0.15 + 0.5) · Normal.xy = (0.4, 0.65) · Final Texture Color for normal vector = (0.4, 0.65, 1); So, that’s how we store our negative to positive ranged tangent normal vector into a texture. It also explains why the default normal color, describing no change in normal direction, is the bluish-purple color of (0.5,0.5,1), as it describes the converted range of (0,0,1) into the texture range. How then, when we sample this normal from the texture, do we get back into the negative to positive range? The Unpack Normal function contains this conversion, that takes the X and Y components and multiplies them by 2, then subtracts 1 from it. See it expressed below: Normal.xy = normal.xy * 2 – 1; Let’s look at an example with the same normal vector we used before: · Texture Normal Vector = (0.4, 0.65, 1) · Normal.xy = (0.4, 0.65) * 2 – 1 · Normal.xy = (0.4 * 2 – 1, 0.65 * 2 - 1) · Normal.xy = (0.8 – 1, 1.3 - 1) · Normal.xy = (-0.2, 0.3) · Final Unpacked Tangent Normal Vector = (-0.2, 0.3, 1) · That’s what our original vector was! As you may have noticed, the X and Y components contribute the most to the deviation of the normal. When performing calculations with normals, for example lighting, we often use normalized vectors. You may have also seen certain textures and compression formats only requiring the X and Y components of the tangent space normal vector, this is because we can derive the Z component from these two. Just like how in Pythagorean theorem, where A2 + B2 = C2, we can reword to this fit our space, X2 + Y2 = Z2. To get the final value of Z, we square root this result, so Z = √ (X2 + Y2). But since we are working with normalized vectors (also called unit vectors), the final magnitude will add up to a value of 1. To put that in our original formula, it would first look like: 1 = X2 + Y2 + Z2, but we can reword it to: Z2 = 1 – X2 + Y2. To get the final value of Z, we just square root this equation, so the formula becomes Z = √(1 – (X2 + Y2)). This formula is what the unity Shader Graph Node Normal Reconstruct Z performs, as seen here: https://docs.unity3d.com/Packages/com.unity.shadergraph@6.9/manual/Normal-Reconstruct-Z-Node.html Hopefully this has provided some insight into how tangent space is used with normal maps, and a brief explanation of why some of the formulas are used!
  3. Realistic Outdoor Lighting in Unity HDRP Unity has provided a handy cheatsheet for getting scientifically based lighting values into your scene, which can be viewed in the documentation on Physical Light Units: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@11.0/manual/Physical-Light-Units.html For quick lighting setups outside, you will mainly be looking at the Color Temperature, Directional Light Intensities and Exposure Value rows. Color Temperature and Directional Light Intensities can be found in the Directional Light component: And the Exposure Value is found as a component added to a Volume, for instance the Sky And Fog Volume: Example lighting with the cheatsheet Let's have a play with these values to match the time of day we are after. Let's start at noon. With our reference sheet, the values we are concerned with are highlighted below: With these values, our directional light settings look like: And our exposure: Have a play around with the different types of Exposure (i.e. Automatic Histogram, Automatic, Fixed, etc) and the compensation value to tweak the brightness of the final image. With those settings changed, we can get a nice day time lighting, when the directional light is set at 90 degrees on the X component of rotation: With a similar to approach but for a 'low sun', where the directional light is set at 7 degrees on the X omponent of rotation: And a moonlit scene:
×
×
  • Create New...