百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
V

VirtualTexture

> 编程语言
开源

用于 Unity 的虚拟纹理

194 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

用于 Unity 的虚拟纹理

VirtualTexture

Introduction

Virtual texture for unity.

Run The Demo

  1. Open the project with Unity 2018(or later).
  2. Click "Menu -> Demo -> Generate Virtual Texture" to generate needed data, it may takes about 10 minutes.
  3. Open Demo Scene.
  4. Play. Use w/s/a/d and mouse to move the camera.
Screenshot1 Screenshot2

Implement Detail

component output
Feedback Renderer
Feedback Reader
Tiled Texture
Page Table
Screenshot

1. Feedback Renderer

Render the scene with feedback shader:

cpp
fixed4 VTFragFeedback(VTV2f i) : SV_Target
{
	float2 page = floor(i.uv * _VTFeedbackParam.x);
	float2 uv = i.uv * _VTFeedbackParam.y;
	float2 dx = ddx(uv);
	float2 dy = ddy(uv);
	int mip = clamp(int(0.5 * log2(max(dot(dx, dx), dot(dy, dy))) + 0.5 + _VTFeedbackParam.w), 0, _VTFeedbackParam.z);

	return fixed4(page / 255.0, mip / 255.0, 1);
}

2. Feedback Reader

Readback feedback texture from gpu to cpu.

3. Tiled Texture

Load all need texture tiles into TiledTexture.

4. Page Table

update page table and lookup texture.

5. Shading

cpp
fixed4 VTFragUnlit(VTV2f i) : SV_Target
{
	float2 uv = VTTransferUV(i.uv);
	fixed4 col = VTTex2D0(uv);
	return col;
}

float2 VTTransferUV(float2 uv)
{
	float2 uvInt = uv - frac(uv * _VTPageParam.x) * _VTPageParam.y;
	fixed4 page = tex2D(_VTLookupTex, uvInt) * 255;
	float2 inPageOffset = frac(uv * exp2(_VTPageParam.z - page.b));
	float2 inTileOffset = inPageOffset * _VTTileParam.y + _VTTileParam.x;
	return (page.rg + inTileOffset) * _VTTileParam.zw;
}

fixed4 VTTex2D0(float2 uv)
{
	return tex2D(_VTTiledTex0, uv);
}

Reference

http://www.silverspaceship.com/src/svt/

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言