小编Pod*_*dis的帖子

Shadertoy - fragCoord vs iResolution vs fragColor

总的来说,我对 Shadertoy 和 GLSL 相当陌生。我已经成功地将许多 Shadertoy 着色器复制到 Blender 中,但实际上并不知道它是如何工作的。我一直在寻找教程,但我更像是一个视觉学习者。

如果有人可以解释,或者甚至更好,提供一些描述 fragCoord、iResolution 和 fragColor 之间差异的图像。那很好啊!

我主要对数字感兴趣。因为我使用 Blender 我习惯了画布是 0 到 1 -或- -1 到 1

这个特别让我有点困惑。

vec2 u = (fragCoord - iResolution.xy * .5) / iResolution.y * 8.;
Run Code Online (Sandbox Code Playgroud)

例子

在不知道坐标系的情况下,我无法在 Blender 中重现剩余的代码。

任何帮助将不胜感激!

shader glsl

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

C++使用动态数组将小写更改为大写

我正在尝试使用动态数组将小写单词更改为大写单词.在遇到"堆腐败"之前,我碰到了一些我没有遇到的事情.有人可以向我解释我做错了什么,可能有助于解决这个问题?

#include <iostream>
#include <cctype>
#include <new>
#include <string>
using namespace std;

int main()
{
    int i;
    int w;
    char *p;
    string str;

    cout << "Change lowercase to UPPERCASE!" << endl;
    cout << "Enter Word: ";
    cin >> str;
    w = str.length();

    p = new (nothrow) char[w];

    if (p == nullptr)
        cout << "Error: memory could not be allocated" << endl;
    else
    {
        cout << "Re-Enter Word: ";
        cin >> p[w];
        for (i = 0; i < w; i++)
            cout …
Run Code Online (Sandbox Code Playgroud)

c++ pointers dynamic-arrays

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

标签 统计

c++ ×1

dynamic-arrays ×1

glsl ×1

pointers ×1

shader ×1