Skip to content

Instantly share code, notes, and snippets.

View ogrew's full-sized avatar

ayato ogrew

View GitHub Profile
@ogrew
ogrew / dockerfile
Last active June 27, 2023 23:28
DualStyleGAN setup
# pull ubuntu 18.04 as base image
FROM nvidia/cuda:11.3.0-devel-ubuntu20.04
RUN echo "start building..."
# update packages
RUN set -x && \
apt update && \
apt upgrade -y
# 必要なライブラリをインポート
import sys
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
# Google APIキーを指定
api_key = 'XXXXXXXXXXXXXXXXXXXXXXXXXX'
# 動画タイトルを取得する関数
def get_channel_videos(channel_id, num):
@ogrew
ogrew / LocalPushNotificaion.cs
Last active January 27, 2023 06:30
Unityローカルプッシュの実装(2023年)
// base : https://qiita.com/townsoft/items/dd5cbd8be7590e12f3cf
#if UNITY_ANDROID
using Unity.Notifications.Android;
#endif
#if UNITY_IOS
using Unity.Notifications.iOS;
#endif
@ogrew
ogrew / InstancedIndirectColor.shader
Last active May 14, 2022 06:57
DrawMeshInstancedIndirectを試す_Shader(その1)
Shader "Custom/InstancedIndirectColor"
{
SubShader
{
CGINCLUDE
#include "UnityCG.cginc"
#include "Lighting.cginc"
#include "AutoLight.cginc"
#include "UnityLightingCommon.cginc"
struct MeshProperties {
@ogrew
ogrew / DrawMeshInstancedIndirect_demo.cs
Last active May 14, 2022 06:27
DrawMeshInstancedIndirectを試す(その1)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DrawMeshInstancedIndirect_demo : MonoBehaviour
{
public int count = 10000;
public float radius = 10;
public Mesh copyMesh;
public Material material;
@ogrew
ogrew / InstancedColorV2.shader
Last active May 13, 2022 16:15
DrawMeshInstancedを試す_Shader(その2)
Shader "Custom/InstancedColorV2"
{
SubShader
{
CGINCLUDE
#include "UnityCG.cginc"
#include "Lighting.cginc"
#include "AutoLight.cginc"
ENDCG
@ogrew
ogrew / DrawMeshInstanced_demo2.cs
Last active May 13, 2022 17:59
DrawMeshInstancedを試す(その2)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
public class DrawMeshInstanced_demo2 : MonoBehaviour
{
public int count = 1000;
public float radius = 5;
public Mesh copyMesh;
@ogrew
ogrew / InstancedColor.shader
Last active May 13, 2022 15:57
DrawMeshInstancedを試す_Shader(その1)
Shader "Custom/InstancedColor"
{
SubShader
{
CGINCLUDE
#include "UnityCG.cginc"
ENDCG
Pass
{
@ogrew
ogrew / DrawMeshInstanced_demo.cs
Created May 13, 2022 15:05
DrawMeshInstancedを試す(その1)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
public class DrawMeshInstanced_demo : MonoBehaviour
{
[SerializeField] private int count = 1000;
[SerializeField] private float radius = 5;
[SerializeField] private Mesh copyMesh;
@ogrew
ogrew / juliaSet.js
Last active April 18, 2022 02:57
ジュリア集合を描く
let gridScale = 2.1;
let border = 2.7;
let maxCount = 150;
function getRealPart(x) {
let rp = -1/2 + 1.0 * x / width;
let s = height / width;
return rp * gridScale/s;
}