texture1D visualizer, changed emitter gradient to texture1D
This commit is contained in:
@@ -15,6 +15,7 @@ enum IMAGE_FLAGS
|
||||
IMAGE_FLAG_DISTORTION_MASK = 1u << 8u,
|
||||
IMAGE_FLAG_HIGHLIGHT = 1u << 9u,
|
||||
IMAGE_FLAG_CUBEMAP_BASE = 1u << 10u,
|
||||
IMAGE_FLAG_TEXTURE1D_BASE = 1u << 11u,
|
||||
};
|
||||
|
||||
struct alignas(16) ImageConstants
|
||||
|
||||
@@ -10,7 +10,7 @@ static const float3 BILLBOARD[] = {
|
||||
float3(1, 1, 0), // 4
|
||||
};
|
||||
|
||||
Texture2D<float> opacityCurveTex : register(t0);
|
||||
Texture1D<float> opacityCurveTex : register(t0);
|
||||
|
||||
RWStructuredBuffer<Particle> particleBuffer : register(u0);
|
||||
RWStructuredBuffer<uint> aliveBuffer_CURRENT : register(u1);
|
||||
@@ -47,7 +47,7 @@ void main(uint3 DTid : SV_DispatchThreadID, uint Gid : SV_GroupIndex)
|
||||
|
||||
const float lifeLerp = 1 - particle.life / particle.maxLife;
|
||||
const float particleSize = lerp(particle.sizeBeginEnd.x, particle.sizeBeginEnd.y, lifeLerp);
|
||||
const float lifeOpa = opacityCurveTex.SampleLevel(sampler_linear_clamp, float2(lifeLerp, 0), 0);
|
||||
const float lifeOpa = opacityCurveTex.SampleLevel(sampler_linear_clamp, lifeLerp, 0);
|
||||
|
||||
// integrate:
|
||||
particle.force += xParticleGravity;
|
||||
|
||||
@@ -220,6 +220,8 @@ float3x3 adjoint(in float4x4 m)
|
||||
"SRV(t0, space = 26, offset = 0, numDescriptors = unbounded, flags = DESCRIPTORS_VOLATILE | DATA_VOLATILE)," \
|
||||
"SRV(t0, space = 27, offset = 0, numDescriptors = unbounded, flags = DESCRIPTORS_VOLATILE | DATA_VOLATILE)," \
|
||||
"SRV(t0, space = 28, offset = 0, numDescriptors = unbounded, flags = DESCRIPTORS_VOLATILE | DATA_VOLATILE)," \
|
||||
"SRV(t0, space = 29, offset = 0, numDescriptors = unbounded, flags = DESCRIPTORS_VOLATILE | DATA_VOLATILE)," \
|
||||
"SRV(t0, space = 30, offset = 0, numDescriptors = unbounded, flags = DESCRIPTORS_VOLATILE | DATA_VOLATILE)," \
|
||||
"UAV(u0, space = 100, offset = 0, numDescriptors = unbounded, flags = DESCRIPTORS_VOLATILE | DATA_VOLATILE)," \
|
||||
"UAV(u0, space = 101, offset = 0, numDescriptors = unbounded, flags = DESCRIPTORS_VOLATILE | DATA_VOLATILE)," \
|
||||
"UAV(u0, space = 102, offset = 0, numDescriptors = unbounded, flags = DESCRIPTORS_VOLATILE | DATA_VOLATILE)," \
|
||||
@@ -299,6 +301,8 @@ static const BindlessResource<Texture2D<float2>> bindless_textures_float2;
|
||||
static const BindlessResource<Texture2D<uint>> bindless_textures_uint;
|
||||
static const BindlessResource<Texture2D<uint4>> bindless_textures_uint4;
|
||||
static const BindlessResource<Texture2D<half4>> bindless_textures_half4;
|
||||
static const BindlessResource<Texture1D<float4>> bindless_textures1D;
|
||||
static const BindlessResource<Texture1D<half4>> bindless_textures1D_half4;
|
||||
|
||||
static const BindlessResource<RWTexture2D<float4>> bindless_rwtextures;
|
||||
static const BindlessResource<RWByteAddressBuffer> bindless_rwbuffers;
|
||||
@@ -357,6 +361,8 @@ static const uint DESCRIPTOR_SET_BINDLESS_ACCELERATION_STRUCTURE = 7;
|
||||
[[vk::binding(0, DESCRIPTOR_SET_BINDLESS_SAMPLED_IMAGE)]] Texture2D<uint> bindless_textures_uint[];
|
||||
[[vk::binding(0, DESCRIPTOR_SET_BINDLESS_SAMPLED_IMAGE)]] Texture2D<uint4> bindless_textures_uint4[];
|
||||
[[vk::binding(0, DESCRIPTOR_SET_BINDLESS_SAMPLED_IMAGE)]] Texture2D<half4> bindless_textures_half4[];
|
||||
[[vk::binding(0, DESCRIPTOR_SET_BINDLESS_SAMPLED_IMAGE)]] Texture1D<half4> bindless_textures1D[];
|
||||
[[vk::binding(0, DESCRIPTOR_SET_BINDLESS_SAMPLED_IMAGE)]] Texture1D<half4> bindless_textures1D_half4[];
|
||||
|
||||
[[vk::binding(0, DESCRIPTOR_SET_BINDLESS_STORAGE_BUFFER)]] RWByteAddressBuffer bindless_rwbuffers[];
|
||||
[[vk::binding(0, DESCRIPTOR_SET_BINDLESS_STORAGE_TEXEL_BUFFER)]] RWBuffer<uint> bindless_rwbuffers_uint[];
|
||||
@@ -409,6 +415,8 @@ Buffer<half> bindless_buffers_half[] : register(space25);
|
||||
Buffer<half2> bindless_buffers_half2[] : register(space26);
|
||||
Buffer<half3> bindless_buffers_half3[] : register(space27);
|
||||
Buffer<half4> bindless_buffers_half4[] : register(space28);
|
||||
Texture1D<float4> bindless_textures1D[] : register(space29);
|
||||
Texture1D<half4> bindless_textures1D_half4[] : register(space30);
|
||||
|
||||
RWTexture2D<float4> bindless_rwtextures[] : register(space100);
|
||||
RWByteAddressBuffer bindless_rwbuffers[] : register(space101);
|
||||
|
||||
@@ -26,6 +26,10 @@ float4 main(VertextoPixel input) : SV_TARGET
|
||||
tex = bindless_cubemaps_half4[descriptor_index(image.texture_base_index)].SampleLevel(sam, cube_dir, 0);
|
||||
}
|
||||
}
|
||||
else if(image.flags & IMAGE_FLAG_TEXTURE1D_BASE)
|
||||
{
|
||||
tex = bindless_textures1D_half4[descriptor_index(image.texture_base_index)].Sample(sam, uvsets.x);
|
||||
}
|
||||
else
|
||||
{
|
||||
tex = bindless_textures_half4[descriptor_index(image.texture_base_index)].Sample(sam, uvsets.xy);
|
||||
|
||||
@@ -906,6 +906,7 @@ namespace wi
|
||||
data[i + startup_length + keep_length] = uint16_t(t * 65535);
|
||||
}
|
||||
TextureDesc desc;
|
||||
desc.type = TextureDesc::Type::TEXTURE_1D;
|
||||
desc.width = arraysize(data);
|
||||
desc.format = Format::R16_UNORM;
|
||||
desc.bind_flags = BindFlag::SHADER_RESOURCE;
|
||||
|
||||
@@ -167,6 +167,10 @@ namespace wi::image
|
||||
{
|
||||
image.flags |= IMAGE_FLAG_CUBEMAP_BASE;
|
||||
}
|
||||
if (texture != nullptr && texture->GetDesc().type == TextureDesc::Type::TEXTURE_1D)
|
||||
{
|
||||
image.flags |= IMAGE_FLAG_TEXTURE1D_BASE;
|
||||
}
|
||||
|
||||
image.hdr_scaling_aspect = wi::math::pack_half2(params.hdr_scaling, canvas_aspect);
|
||||
image.bordersoften_saturation = wi::math::pack_half2(params.border_soften, params.saturation);
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace wi::version
|
||||
// minor features, major updates, breaking compatibility changes
|
||||
const int minor = 71;
|
||||
// minor bug fixes, alterations, refactors, updates
|
||||
const int revision = 673;
|
||||
const int revision = 674;
|
||||
|
||||
const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user