threejs(13)-shader set point material

Shader material built-in variables The built-in variables of the three.js shader are gl_PointSize: In point rendering mode, controls the rendering pixel size of the square point area (note that this is the pixel size, not the three.js unit, so when the camera is moved, the size of the point seen on the screen remains unchanged) […]

threejs(12)-shader to create smoke and water cloud effect

1. Encapsulate the water ripple effect yourself src/main/main01.js import * as THREE from “three”; import {<!– –> OrbitControls } from “three/examples/jsm/controls/OrbitControls”; import gsap from “gsap”; import * as dat from “dat.gui”; import vertexShader from “../shaders/water/vertex.glsl”; import fragmentShader from “../shaders/water/fragment.glsl”; // Goal: Set the cloud smoke effect //Create gui object const gui = new dat.GUI(); // […]

C# OpenCvSharp corn kernel counting

Effect Project Code using OpenCvSharp; using System; using System.Drawing; using System.Text; using System.Windows.Forms; namespace OpenCvSharp_Demo { public partial class frmMain : Form { public frmMain() { InitializeComponent(); } string fileFilter = “*.*|*.bmp;*.jpg;*.jpeg;*.tiff;*.tiff;*.png”; string image_path = “”; DateTime dt1 = DateTime.Now; DateTime dt2 = DateTime.Now; Mat image; Mat result_image; StringBuilder sb = new StringBuilder(); private void […]

C# OpenCvSharp DNN HybridNets simultaneously handles vehicle detection, drivable area segmentation, and lane line segmentation

Table of Contents Effect Model information project code download Effect Simultaneously handles vehicle detection, drivable area segmentation, and lane line segmentation Model information Inputs ———————– name: input tensor: Float[1, 3, 256, 384] ————————————————– ————- Outputs ———————– name:regression tensor: Float[1, 18414, 4] name:classification tensor: Float[1, 18414, 1] name:segmentation tensor: Float[1, 3, 256, 384] ————————————————– ————- project […]

Exclusive and original! The sparrow optimization algorithm that combines northern goshawk and adaptive t distribution has excellent results! Highly recommended product! MATLAB code…

Statement: Resale and reselling of the author’s original code is prohibited, and violators will be prosecuted! The sparrow search algorithm (SSA) was proposed in 2020 and has been widely used in many fields. The design of the Sparrow algorithm is inspired by the biological characteristics of birds. The mathematical model established based on the foraging […]

threejs(11)-Proficient in shader programming (difficulty) 2

1. Writing advanced patterns with shader Small Japanese flag precision lowp float; varying vec2 vUv; float strength = step(0.5,distance(vUv,vec2(0.5)) + 0.25); gl_FragColor =vec4(strength,strength,strength,strength); Draw a circle precision lowp float; varying vec2 vUv; float strength = 1.0 – step(0.5,distance(vUv,vec2(0.5)) + 0.25); gl_FragColor =vec4(strength,strength,strength,strength); Ring precision lowp float; varying vec2 vUv; float strength = step(0.5,distance(vUv,vec2(0.5)) + 0.35); […]

Reasons and solutions for GPU CUDA running speed not to increase but to decrease when using shared memory

I wrote several operators for adding two images and image filtering, respectively using shared memory for optimization. #include <stdio.h> #include <cuda_runtime.h> #include “helper_cuda.h” #include “helper_timer.h” #define BLOCKX 32 #define BLOCKY 32 #define BLOCK_SIZE 1024 #define PADDING 2 __global__ void filter5x5(float* in, float* out, int nW, int nH) {<!– –> // Thread index —> Global memory […]

Unity shader syntax

Previous article: TA Shader basics shader syntax ShaderLab+CG Unity defines commonly used vertex-based data boxes The default data of the following boxes is as follows, which can be flexibly changed by yourself and loaded with any data type (float, float2, float3, float4): POSITION: location NORMAL: normal TANGENT: tangent TEXCOORD0: texture coordinates TEXCOORD(n): Define the content […]

The use of C++ smart pointers: the use of shared_ptr, weak_ptr, unique_ptr, use case description.

Directory of series articles Contents of this chapter: (1) Introduction to shared_ptr, weak_ptr, unique_ptr (2) Memory leak caused by using share_ptr alone (3) Combined use of shared_ptr and weak_ptr Article directory Table of Contents of Series Articles Preface 1. Use of shared_ptr, weak_ptr, unique_ptr 1.1 shared_ptr 1.2 weak_ptr 1. Creation of weak_ptr pointer 2. Member […]