All Projects → Jeremboo → threejs-texture-tool

Jeremboo / threejs-texture-tool

Licence: other
A tool who build, show and update canvas textures who can be used in a three.js project.

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to threejs-texture-tool

Rxasdatasources
RxDataSource for AsyncDisplayKit/Texture
Stars: ✭ 114 (+418.18%)
Mutual labels:  texture
Unity Texture Curve
✏️ Example showing how to bake an AnimatedCurve into a Texture and use it in a shader.
Stars: ✭ 149 (+577.27%)
Mutual labels:  texture
Rom Properties
ROM Properties Page shell extension
Stars: ✭ 210 (+854.55%)
Mutual labels:  texture
Pex Context
Modern WebGL state wrapper for PEX: allocate GPU resources (textures, buffers), setup state pipelines and passes, and combine them into commands.
Stars: ✭ 117 (+431.82%)
Mutual labels:  texture
Gltfforue4
Import glTF 2.0 in Unreal Engine
Stars: ✭ 145 (+559.09%)
Mutual labels:  texture
Threejs Path Flow
🐬🐟 ↶Mesh Deformation / Bending / Following on a Curve
Stars: ✭ 165 (+650%)
Mutual labels:  texture
Wechatswift
iOS WeChat App Written in Swift 5.0
Stars: ✭ 102 (+363.64%)
Mutual labels:  texture
Blacksmith
Blacksmith is a tool for viewing, extracting, and converting textures, 3D models, and sounds from Assassin's Creed: Odyssey/Origins/Valhalla and Steep.
Stars: ✭ 104 (+372.73%)
Mutual labels:  texture
Mmtexturechat
AsyncDisplayKit(Texture) Smooth Scroll Chat Simulation for Whatsapp and iMessage
Stars: ✭ 149 (+577.27%)
Mutual labels:  texture
Glslviewer
Console-based GLSL Sandbox for 2D/3D shaders shaders
Stars: ✭ 2,834 (+12781.82%)
Mutual labels:  texture
Cube2sphere
Python script to map 6 cube (cubemap, skybox) faces into an equirectangular (cylindrical projection, skysphere) map.
Stars: ✭ 120 (+445.45%)
Mutual labels:  texture
Adversarialtexture
Adversarial Texture Optimization from RGB-D Scans (CVPR 2020).
Stars: ✭ 124 (+463.64%)
Mutual labels:  texture
Nvjob Water Shader Simple And Fast
#NVJOB Simple Water Shaders. Free Unity Asset.
Stars: ✭ 172 (+681.82%)
Mutual labels:  texture
Openmvs
open Multi-View Stereo reconstruction library
Stars: ✭ 1,842 (+8272.73%)
Mutual labels:  texture
Dterrain
Destructible terrain in Unity
Stars: ✭ 224 (+918.18%)
Mutual labels:  texture
Textureswiftsupport
A library to gain us the DSL to define layout spec in Texture [like SwiftUI]
Stars: ✭ 105 (+377.27%)
Mutual labels:  texture
Patches
Patches is a visual programming editor for building WebVR and WebGL experiences.
Stars: ✭ 164 (+645.45%)
Mutual labels:  texture
Texture-KR-Wiki
Texture (AsyncDisplayKit) Wiki - 한국어
Stars: ✭ 42 (+90.91%)
Mutual labels:  texture
Unity Shader Basics Tutorial
A introduction into creating shaders for Unity
Stars: ✭ 243 (+1004.55%)
Mutual labels:  texture
Rectpack2d
A header-only, quite efficient rectangle packing library.
Stars: ✭ 177 (+704.55%)
Mutual labels:  texture

ThreejsTextureTool 0.5.1

A tool to preview and update your canvases or pictures used for your three.js textures.

demo 0.2.6

Getting Started (es6)

Create a texture with a dynamic canvas

Threejs Texture Tool canvas texture demo

import { createCanvasTexture } from 'threejs-texture-tool';

// Create a canvasTexture
const canvasTexture = createCanvasTexture({
  name: 'myCanvas',
  onStart: (props) => {
    // Draw once a rectangle and add a mouse move Listener
    // To update this canvas
    const { width, height, context, canvas, update } = props;
    context.rect(0, 0, width, height);
    context.fillStyle = '#F6FF49';
    context.fill();
    canvas.onmousemove = e => {
      update(e.offsetX, e.offsetY);
    };
  },
  onUpdate: (x, y) => {
    // Called by `canvasTexture.udpate(...)`
    const { context } = canvasTexture;
    context.beginPath();
    context.arc(x, y, 10, 0, 2 * Math.PI, false);
    context.fillStyle = mainColor;
    context.fill();
    context.closePath();
  },
});

// Different accesses
const { texture, material, uniform, canvas } = canvasTexture;

Create a texture with a picture

Threejs Texture Tool demo with picture

import { createImageTexture } from 'threejs-texture-tool';

// Load the picture
const imgTexture = createImageTexture('./test1.jpg', { name: 'test', onLoad: () => {
  // Manipulate params
  imgTexture.texture.wrapS =
  imgTexture.texture.wrapT =
  imgTexture.uniform.value.wrapS =
  imgTexture.uniform.value.wrapT =
  REPEAT_WRAPPING;
} });

// Different accesses
const { texture, material, uniform, image } = canvasTexture;

Get material / uniform and other transformations

For the both textureTools, you can get her material and uniform object compatible with three.js

// Use it as material
const mesh = THREE.Mesh(
  new BoxGeometry(1, 1, 1),
  imageOrCanvasTexture.material,
);

// Into shaderMaterial
const shaderMaterial = new ShaderMaterial({
  uniforms: {
    imgMap: imageOrCanvasTexture.uniform,
  },
  vertexShader: shaderVert,
  fragmentShader: shaderFrag,
  side: DoubleSide,
});

// Get only the picture
const img = document.createElement('img');
img.src = imageTexture.image;

// Get only the canvas
const canvas = canvasTexture.canvas;

TODO / NEXT STEP

  • remplace dragDrop dependencie from scratch

  • drag and move all openned textures anywhere in the view

  • reset each canvas texture with a button

  • functions to generate specific canvas textures :

    • noiseTexture
    • perlinNoiseTexture
    • gradientTexture
    • perlinGradientNoiseTexture
    • customTexture
    • fusionTexture / superposeTextures
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].