小编and*_*dre的帖子

VR 中的着色器分析

我想创建一个像这样的着色器,它采用世界坐标并创建波浪。我想分析视频并了解所需的步骤。我不是在寻找代码,我只是在寻找如何使用 GLSL 或 HLSL 或任何其他语言来实现它的想法。

这里是低质量和 fps GIF,以防链接中断。

视频

这是片段着色器:

#version 330 core

// Interpolated values from the vertex shaders
in vec2 UV;
in vec3 Position_worldspace;
in vec3 Normal_cameraspace;
in vec3 EyeDirection_cameraspace;
in vec3 LightDirection_cameraspace;

// highlight effect
in float pixel_z;       // fragment z coordinate in [LCS]
uniform float animz;    // highlight animation z coordinate [GCS]

// Ouput data
out vec4 color;
vec3 c;

// Values that stay constant for the whole mesh.
uniform sampler2D myTextureSampler;
uniform mat4 MV;
uniform vec3 …
Run Code Online (Sandbox Code Playgroud)

opengl directx shader augmented-reality

1
推荐指数
1
解决办法
890
查看次数

使用C++在微控制器上显示位图图形

我正在使用十六进制格式的888到565格式的位图.所以我想,以显示对使用SDL模拟器的位图,与帧缓冲区resoultion是16bit.

其中一个位图数据(第一行)看起来像那样

0x42, 0x4D, 0xFE, 0x82, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x36, 0x0, 0x0, 0x0, 0x28, 0x0, 0x0, 0x0, 0x7B, 0x0, 0x0, 0x0, 0x5A, 0x0, 0x0, 0x0, 0x1, 0x0, 0x18, 0x0, 0x0, 0x0, 
Run Code Online (Sandbox Code Playgroud)

现在我正在尝试在SDL上使用C++绘制该位图,但是我得到了带有扫描线的垃圾图像,看起来像是没有正确计算间距.

void Rasterizer::DrawBitmap(int w, int h, int x, int y, int transparent)
{
    if (!bitmap)
        return;

    const uint8_t bytesPerPixel = 2;
    uint16_t bytesPerRow = (bytesPerPixel * h ); // bytes Per Row including padding to 4 byte row boundary
    uint16_t paddingSize = bytesPerRow - (bytesPerPixel * …
Run Code Online (Sandbox Code Playgroud)

c++ sdl bitmap

0
推荐指数
1
解决办法
140
查看次数

从 csv 中读取 Pandas 中没有标签的列

我有以下格式的 csv 文件:

15.55   28.65   2
14.9    27.55   2
14.45   28.35   2
14.15   28.8    2
13.75   28.05   2
Run Code Online (Sandbox Code Playgroud)

我想阅读它并将其保存为 X,Y, Clusters。

我尝试了以下但我没有得到任何数据

data = pd.read_csv(filename)

X = column(data, 0)
X = np.asarray(X)
Y = column(data,1)
Y = np.asarray(Y)
Run Code Online (Sandbox Code Playgroud)

python csv python-3.x pandas

0
推荐指数
1
解决办法
2629
查看次数

标签 统计

augmented-reality ×1

bitmap ×1

c++ ×1

csv ×1

directx ×1

opengl ×1

pandas ×1

python ×1

python-3.x ×1

sdl ×1

shader ×1