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; | |
namespace kmty.Util | |
{ | |
public class MeanShift | |
{ | |
public float Threshold { get; private set; } | |
public int LoopLimit { get; private set; } | |
public Vector2[] Samples { get; private set; } |
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
let cvs = document.getElementById('cvs') | |
cvs.width = 800 | |
cvs.height = 600 | |
let renderer = new PIXI.WebGLRenderer(cvs.width, cvs.height, {view: cvs, antialias: true} ) | |
let container = new PIXI.Container() | |
let img = new Image() | |
img.src = "/images/detail/" + imgID + ".jpg"; |
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
<template lang="html"> | |
<div :class="'img-'+this.mainImgID" id="cvs_thumnails_box"> | |
<canvas id="cvs"> | |
</canvas> | |
<div id="thumbnails"> | |
<div v-for="t in thumbnails" @click="changeImg(t.id)" :class="'thumbnail-'+ t.id" class="thumbnail"> | |
</div> | |
</div> | |
</div> | |
</template> |
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
#ifndef NOISE4D_INCLUDED | |
#define NOISE4D_INCLUDED | |
float4 mod289(float4 x) { | |
return x - floor(x * (1.0 / 289.0)) * 289.0; | |
} | |
float mod289(float x) { | |
return x - floor(x * (1.0 / 289.0)) * 289.0; | |
} |
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
<script lang="ts"> | |
import * as rndr from './renderer' | |
import { onMount } from 'svelte'; | |
export let onstart: () => void = () => {}; | |
export let onupdate: () => void = () => {}; | |
let cvs: HTMLElement; | |
onMount(() => { | |
cvs.appendChild( rndr.rnd.domElement ); | |
onstart(); |
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
import { useEffect, useRef } from "react"; | |
import * as THREE from "three"; | |
const App = () => { | |
const ref = useRef<HTMLDivElement>(null); | |
const scn = new THREE.Scene(); | |
const cam = new THREE.PerspectiveCamera(75, 1, 0.1, 1000); | |
const rnd = new THREE.WebGLRenderer(); | |
useEffect(() => { |
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
// https://light11.hatenadiary.com/entry/2022/04/25/190849 | |
Shader "PBRExample" | |
{ | |
Properties | |
{ | |
_BaseMap("Base Map", 2D) = "white" {} | |
_BaseColor("Base Color", Color) = (1, 1, 1, 1) | |
[Normal] _NormalMap("Normal Map", 2D) = "bump" {} | |
_Metallic("Metallic", Range(0.0, 1.0)) = 0.0 | |
_Smoothness("Smoothness", Range(0.0, 1.0)) = 0.0 |