Shader "MaterialPropertyDrawer"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
[HideInInspector] _MainTex2("Hide Texture", 2D) = "white" {}
This file contains hidden or 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
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> | |
| <style> | |
| body { | |
| margin: 0px; | |
| overflow: hidden; | |
| } |
This file contains hidden or 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
| Shader "Name" { | |
| Properties { | |
| _Name ("display name", Range (min, max)) = number | |
| _Name ("display name", Float) = number | |
| _Name ("display name", Int) = number | |
| _Name ("display name", Color) = (number,number,number,number) | |
| _Name ("display name", Vector) = (number,number,number,number) |
This file contains hidden or 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
| in vec2 v_texcoord; // texture coords | |
| in vec3 v_normal; // normal | |
| in vec3 v_binormal; // binormal (for TBN basis calc) | |
| in vec3 v_pos; // pixel view space position | |
| out vec4 color; | |
| layout(std140) uniform Transforms | |
| { | |
| mat4x4 world_matrix; // object's world position |
This file contains hidden or 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
| // This is free and unencumbered software released into the public domain. | |
| // | |
| // Anyone is free to copy, modify, publish, use, compile, sell, or | |
| // distribute this software, either in source code form or as a compiled | |
| // binary, for any purpose, commercial or non-commercial, and by any | |
| // means. | |
| // | |
| // In jurisdictions that recognize copyright laws, the author or authors | |
| // of this software dedicate any and all copyright interest in the | |
| // software to the public domain. We make this dedication for the benefit |
This file contains hidden or 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
| // c# companion script | |
| // SpriteUVToShader.cs -------------------------------------------------------------------------------------------------------------------------------- // | |
| // Save you your project, add to your SpriteRenderer gameObject | |
| using UnityEngine; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| [ExecuteInEditMode] |
This file contains hidden or 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
| //先做Gerstner Wave | |
| //波形采用分层随机叠加的方式,通过参数进行调节。以下代码让波长逐渐增加,同时生成了相位和角度。角度是用来控制波的方向。 | |
| public void GenerateWaveData(int componentsPerOctave, ref float[] wavelengths, ref float[] anglesDeg, ref float[] phases) | |
| { | |
| int totalComponents = NUM_OCTAVES * componentsPerOctave; | |
| if (wavelengths == null || wavelengths.Length != totalComponents) wavelengths = new float[totalComponents]; | |
| if (anglesDeg == null || anglesDeg.Length != totalComponents) anglesDeg = new float[totalComponents]; | |
| if (phases == null || phases.Length != totalComponents) phases = new float[totalComponents]; | |
| float minWavelength = Mathf.Pow(2f, SMALLEST_WL_POW_2); | |
| float invComponentsPerOctave = 1f / componentsPerOctave; |
This file contains hidden or 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; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UnityEditor; | |
| using UnityEditor.Callbacks; | |
| using System.IO; | |
| using System.Text.RegularExpressions; | |
| public class AdincubeEditor : Editor | |
| { | |
| //打包完成后调用该方法 |
This file contains hidden or 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
| protoc --cpp_out=. pb_orm_test.proto | |
| protoc --mysql_out=. pb_orm_test.proto | |
| g++ -g storage.cc main.cc pb_orm_test.pb.cc -lmysqlclient -lprotobuf -L/home/taohan/open_src/protobuf/protobuf-2.6.1/src/.libs -L/usr/local/mysql/lib |
This file contains hidden or 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
| //Copyright (c) 2014 Tilman Schmidt (@KeyMaster_) | |
| //Permission is hereby granted, free of charge, to any person obtaining a copy | |
| //of this software and associated documentation files (the "Software"), to deal | |
| //in the Software without restriction, including without limitation the rights | |
| //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| //copies of the Software, and to permit persons to whom the Software is | |
| //furnished to do so, subject to the following conditions: | |
| //The above copyright notice and this permission notice shall be included in |
