Tracesets handling proposal
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- compilers
Hướng nghiên cứu
Bắt đầu với tài liệu OSL trace hiện tại và cú pháp traceset hiện có được mô tả trong issue. So sánh các danh sách bao gồm/loại trừ, các đối số tuple, các tập hợp ngầm định và cú pháp biểu thức được đề xuất trước khi chọn một hướng tập trung. Được xem là hoàn tất khi có một đặc tả đã được thống nhất cùng với kế hoạch triển khai và xác thực được xác định.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Motivation
The OSL, in its current state, doesn't specify technical details or syntax, other than this line in the docs:
An optional named set of objects to ray trace (if preceded by a - character, it means to exclude that set).
So technically it can only pass an inclusion or exclusion list of predefined sets (not an expression) to the renderer.
Simple logical operations unavailable, e.g.: "Character -Hair"
Sometimes we want to trace only against the object itself, or exclude the currently shaded object from tracing without creating hundreds of tracesets for all instances.
We can employ string features of OSL to implement desired behaviour, but it's inefficient.
Workarounds
Exclude itself ( taken from LaSh )
// Assign unique tracesets to all objects in DCC ahead of rendertime. (RfK should do it for you)
string traceset;
getattribute( "identifier:name", traceset );
traceset = concat( "-", traceset ); // String concatination isn't efficient
int hit = trace( P, dir,
"traceset", traceset );
Allow user to format string. User is free to set the userDefined parameter to "%s" or "-%s" or "%s ground"
// Assign unique tracesets to all objects in DCC ahead of rendertime.
string self, resultingTraceset;
getattribute( "grouping:membership", self);
resultingTraceset = format(userDefined, self); // Performance warning about rendertime formatting
int hit = trace( P, dir,
"traceset", resultingTraceset );
Inspiration
VEX - SideFX Houdini language allows you to:
use wildcards
"Object*"
use complex expressions"Object*,^*left"
refer to implicit sets using special keywords like"scope:self"
Pixar RenderMan texture system allows you to do complex string substitutions to define texture paths.
<primstr:primvarname>- will substitute the value of the named constant string primitive variable, such as the name of an asset; for example,"/assets/<primstr:model>/diffuse.tex"on an apple with "const string model" ["apple"] would be expanded to"/assets/apple/diffuse.tex"
Seems Arnold renderer also has an implicit self traceset assignment, but I didn't find it in the documentation.
Adopting these ideas and syntax in the language might be very helpful in solving current problems. However, I understand the complexity of this solution.
Simpler solution
Even without introducing a complex evaluation system, we can achieve more flexibility and robustness by:
Separating the inclusion list from the exclusion list in the trace signature will allow simple constructions (e.g. include Character, but not its Hair) and prevent preceding "-" concatenation.
int trace (point pos, vector dir,
"tracesetInclude", string includeList,
"tracesetExclude, string excludeList)
Accepting tracesets as tuples (not as a single string) will also help to avoid runtime string concatenations and potentially parsing at render time.
int trace (point pos, vector dir,
"tracesetInclude", string[] includeList,
"tracesetExclude, string[] excludeList)
Having OSL opinion about implicit tracesets (like current object or objects with current material assigned (Thanks, Chriss) ) in the specification will help write efficient and transferable shaders.
- Ngôn ngữ chính
- C++
- Star
- 2.3k
- Fork
- 415
- Merge trung bình
- 2 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 14
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của AcademySoftwareFoundation/OpenShadingLanguage
-
build / testing / port / CI
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
AcademySoftwareFoundation/OpenShadingLanguage#2148 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
AcademySoftwareFoundation/OpenShadingLanguage#2109 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
AcademySoftwareFoundation/OpenShadingLanguage#2175 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
AcademySoftwareFoundation/OpenShadingLanguage#2135 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
AcademySoftwareFoundation/OpenShadingLanguage#2132 · 6 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của AcademySoftwareFoundation/OpenShadingLanguage
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
tenstorrent/tt-metal#58057 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
maplibre/maplibre-native#4690 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
comp-query-execution
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
ClickHouse/ClickHouse#122569 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100