Skip to content

3-improving.md中的vertexPosition没有申明,4-directional-lighting.md中的Enhanced directional lighting中的代码块存在语法问题 #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Pycnocline opened this issue Jul 30, 2024 · 2 comments

Comments

@Pycnocline
Copy link

getting-started中可能存在两个问题:

1.在3-improving.md文件中的Back to the Fragment shader (again)部分存在以下代码:

float fogValue = vertexPosition < fogEnd ? smoothstep(fogStart, fogEnd, vertexPosition) : 1.0;

此代码中的vertexPosition没有在上下文中提及且没有声明,推测应该为vertexDistance

2.在4-directional-lighting.md中的Enhanced directional lighting部分存在以下代码:

float NdotL = max(0.2, dot(normal, normalize(shadowLightPosition));

此代码中缺少一个')'

@WGrav01
Copy link

WGrav01 commented Aug 28, 2024

Translated to English:

There are two possible problems in getting-started:

  1. The following code exists in the Back to the Fragment shader (again) section of the 3-improving.md file:

float fogValue = vertexPosition < fogEnd ? smoothstep(fogStart, fogEnd, vertexPosition) : 1.0;

The vertexPosition in this code is not mentioned in the context and is not declared, presumably it should be vertexDistance.

  1. The following code exists in the Enhanced directional lighting section of 4-directional-lighting.md:

float NdotL = max(0.2, dot(normal, normalize(shadowLightPosition));

This code is missing a single ')'.

@WGrav01
Copy link

WGrav01 commented Aug 28, 2024

The first error was fixed in PR #18, I'll open another PR to fix the second issue. (Fixed in #20)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants