frustum culling, multiple materials are being segregated into batches with their own AABB:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma kernel CSMain | |
float4 _FrustumPlanes[6]; // 视锥体的六个面 | |
float3 _BoundMin; // 物体包围盒最小点 | |
float3 _BoundMax; // 物体包围盒最大点 | |
StructuredBuffer<float4x4> _AllMatricesBuffer; // 所有物体的复合变换矩阵 | |
AppendStructuredBuffer<uint> _VisibleIDsBuffer; // 可见物体实例ID | |
bool IsOutsideThePlane(float4 plane, float3 position) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Runtime.InteropServices; | |
using UnityEngine; | |
class Render : MonoBehaviour | |
{ | |
struct DrawData | |
{ | |
public Vector3 Pos; | |
public Quaternion Rot; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Made with Amplify Shader Editor | |
// Available at the Unity Asset Store - http://u3d.as/y3X | |
Shader "Unlit/Directional Tint" | |
{ | |
Properties | |
{ | |
_MainTex("MainTex", 2D) = "white" {} | |
_Color("Color", Color) = (1,1,1,1) | |
_ColorA("ColorA", Color) = (1,1,1,1) | |
_ColorB("ColorB", Color) = (1,1,1,1) |
Unity shows the following warning on mobile devices up to Unity 2019.4: "Please note that Unity WebGL is not currently supported on mobiles. Press OK if you wish to continue anyway." This script helps you remove this warning
To see live examples see Unity Web GL Loading Test
The script will run after the build has completed and replace the checks from all generated javascript files.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEngine; | |
[InitializeOnLoad] | |
class EnableThreads | |
{ | |
static EnableThreads() | |
{ | |
PlayerSettings.WebGL.linkerTarget = WebGLLinkerTarget.Wasm; | |
PlayerSettings.WebGL.threadsSupport = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// budo boop.ts --live --dir . -- -p [ tsify --target es6 ] | |
import * as B from 'babylonjs' | |
import * as parseMagicaVoxel from 'parse-magica-voxel' | |
import * as createAOMesh from 'ao-mesher' | |
import * as fill from 'ndarray-fill' | |
import * as ndarray from 'ndarray' | |
let canvas : any = document.createElement( "canvas" ); | |
document.body.appendChild(canvas) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System; | |
[RequireComponent (typeof(Rigidbody))] | |
public class PhysicsFollower : MonoBehaviour | |
{ | |
public Transform target; | |
Rigidbody rb; |