﻿<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=%E5%88%A9%E7%94%A8%E8%80%85%3AJwilkins%2FVFX%2FAspects</id>
	<title>利用者:Jwilkins/VFX/Aspects - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=%E5%88%A9%E7%94%A8%E8%80%85%3AJwilkins%2FVFX%2FAspects"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Jwilkins/VFX/Aspects&amp;action=history"/>
	<updated>2026-08-01T13:52:31Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Jwilkins/VFX/Aspects&amp;diff=143745&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Jwilkins/VFX/Aspects&amp;diff=143745&amp;oldid=prev"/>
		<updated>2018-06-28T21:04:26Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2018年6月28日 (木) 21:04時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Yamyam</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Jwilkins/VFX/Aspects&amp;diff=143744&amp;oldid=prev</id>
		<title>wiki&gt;Jwilkins: Created page with &quot;= Aspects =  Header File: &lt;tt&gt;GPU_aspect.h&lt;/tt&gt;  An ''aspect'' is a collection of shaders and other features grouped together to do a particular kind of drawing in ''Blender''. A...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Jwilkins/VFX/Aspects&amp;diff=143744&amp;oldid=prev"/>
		<updated>2013-09-23T23:32:18Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Aspects =  Header File: &amp;lt;tt&amp;gt;GPU_aspect.h&amp;lt;/tt&amp;gt;  An &amp;#039;&amp;#039;aspect&amp;#039;&amp;#039; is a collection of shaders and other features grouped together to do a particular kind of drawing in &amp;#039;&amp;#039;Blender&amp;#039;&amp;#039;. A...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Aspects =&lt;br /&gt;
&lt;br /&gt;
Header File: &amp;lt;tt&amp;gt;GPU_aspect.h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An ''aspect'' is a collection of shaders and other features grouped&lt;br /&gt;
together to do a particular kind of drawing in ''Blender''.&lt;br /&gt;
At a low level ''aspects'' can be thought of as a module that handles&lt;br /&gt;
compiling and choosing between ''OpenGL'' shaders.  For example, there&lt;br /&gt;
is an aspect that manages shaders for drawing fonts, another for&lt;br /&gt;
drawing solid 3D meshes, and another for drawing wire frame objects.&lt;br /&gt;
&lt;br /&gt;
The term ''aspect'' is taken from ''aspect-oriented programming'' (''AOP'').&lt;br /&gt;
The idea is that each way of drawing in ''Blender'' is a different facet&lt;br /&gt;
of the more general task of drawing.  In the language of ''AOP'', which&lt;br /&gt;
shader to use at a given time is a &amp;quot;cross cutting concern&amp;quot; of ''Blender'' and&lt;br /&gt;
each kind of drawing (or aspect of drawing) should be controlled through a&lt;br /&gt;
different module and choosing which module to use should be centralized.&lt;br /&gt;
&lt;br /&gt;
Why do we need a special term here? Because words like ''renderer'', ''shader'',&lt;br /&gt;
and ''context'' are already taken and choosing one of those would overload an&lt;br /&gt;
already overburdened term.&lt;br /&gt;
&lt;br /&gt;
The current interface may seem over-engineered, but this is because the&lt;br /&gt;
interface is designed to allow for additional features, such as multi-pass&lt;br /&gt;
drawing and the ability to select between polymorphic implementations of each&lt;br /&gt;
aspect at runtime (including implementations created in ''Python'').  &lt;br /&gt;
For this reason the interface should be considered experimental, as it&lt;br /&gt;
could be either simplified or embellished as this feature evolves.&lt;br /&gt;
&lt;br /&gt;
== Objects ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void GPU_gen_aspects   (size_t count,       uint32_t* aspects);&lt;br /&gt;
void GPU_delete_aspects(size_t count, const uint32_t* aspects);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Aspects are indexed by a &amp;lt;tt&amp;gt;uint32_t&amp;lt;/tt&amp;gt;.&lt;br /&gt;
Creating and destroying those indexes is done using &amp;lt;tt&amp;gt;GPU_gen_aspects&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;GPU_delete_aspects&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These functions operate similarly to ''OpenGL'' &amp;lt;tt&amp;gt;Gen&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Delete&amp;lt;/tt&amp;gt; functions.&lt;br /&gt;
&lt;br /&gt;
== Implementations ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
typedef struct GPUaspectimpl {&lt;br /&gt;
	bool  (*render_begin )(const void* object, void* param);&lt;br /&gt;
	bool  (*render_end   )(const void* object, void* param);&lt;br /&gt;
	bool  (*render_commit)(const void* object);&lt;br /&gt;
	bool  (*select_begin )(const void* object, void* param);&lt;br /&gt;
	bool  (*select_end   )(const void* object, void* param);&lt;br /&gt;
	bool  (*select_commit)(const void* object);&lt;br /&gt;
	void  (*enable       )(const void* object, uint32_t options);&lt;br /&gt;
	void  (*disable      )(const void* object, uint32_t options);&lt;br /&gt;
	void* object;&lt;br /&gt;
} GPUaspectimpl;&lt;br /&gt;
&lt;br /&gt;
void GPU_aspect_impl(uint32_t aspect, GPUaspectimpl* aspectImpl);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Aspects are implemented by a table of functions held in a &amp;lt;tt&amp;gt;GPUaspectimpl&amp;lt;/tt&amp;gt; structure.  The implementation of an aspect is set by &amp;lt;tt&amp;gt;GPU_aspect_impl&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The aspect module does not own the pointer to this table, so it will not be freed when &amp;lt;tt&amp;gt;GPU_delete_aspect&amp;lt;/tt&amp;gt; is called.&lt;br /&gt;
It is up to the allocator of the &amp;lt;tt&amp;gt;GPUaspectimpl&amp;lt;/tt&amp;gt; to free it if it was allocated dynamically,&lt;br /&gt;
but not before &amp;lt;tt&amp;gt;GPU_delete_aspect&amp;lt;/tt&amp;gt; is called or &amp;lt;tt&amp;gt;GPU_aspect_impl&amp;lt;/tt&amp;gt; is called with a different pointer.&lt;br /&gt;
&lt;br /&gt;
Setting the implementation pointer to &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; will return the implementation to its original state (which is a dummy implementation).&lt;br /&gt;
&lt;br /&gt;
Creating a new implementation requires understanding what each of these functions is supposed to do, &lt;br /&gt;
however the aspect module is still in development, so the functions and their purpose are subject to change.&lt;br /&gt;
&lt;br /&gt;
The ''object'' field is meant so that different aspect implementations may use the same functions but have a separate workspace (like a &amp;lt;tt&amp;gt;this&amp;lt;/tt&amp;gt; pointer in ''C++'').&lt;br /&gt;
&lt;br /&gt;
== Switching ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GPU_aspect_begin(uint32_t aspect, const void* object);&lt;br /&gt;
bool GPU_aspect_end(void);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently the ''param'' parameter is always ''NULL''.  &lt;br /&gt;
The ''param'' parameter is intended to provide a local&lt;br /&gt;
context for an aspect so that it can behave different&lt;br /&gt;
depending on where it is called.&lt;br /&gt;
&lt;br /&gt;
Header File: &amp;lt;tt&amp;gt;GPU_blender_aspect.h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
GPU_ASPECT_BASIC&lt;br /&gt;
GPU_ASPECT_CODEGEN&lt;br /&gt;
GPU_ASPECT_FONT&lt;br /&gt;
GPU_ASPECT_PIXELS&lt;br /&gt;
GPU_ASPECT_RASTER&lt;br /&gt;
GPU_ASPECT_SPRITE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are built-in aspects for ''Blender'' that can be in the ''aspect'' field of&lt;br /&gt;
&amp;lt;tt&amp;gt;GPU_aspect_begin&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;GPU_aspect_enable&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;GPU_aspect_disable&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Options ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void GPU_aspect_enable (uint32_t aspect, uint32_t options);&lt;br /&gt;
void GPU_aspect_disable(uint32_t aspect, uint32_t options);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions set and reset flags in the context of each ''aspect''.  &lt;br /&gt;
For example, in &amp;lt;tt&amp;gt;GPU_ASPECT_BASIC&amp;lt;/tt&amp;gt; the &amp;lt;tt&amp;gt;GPU_BASIC_LIGHTING&amp;lt;/tt&amp;gt;&lt;br /&gt;
flag enables or disables whether lighting computations are done.&lt;br /&gt;
&lt;br /&gt;
== Commit ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void GPU_commit_aspect(void);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before drawing anything the &amp;lt;tt&amp;gt;GPU_commit_aspect&amp;lt;/tt&amp;gt; function must be called so that&lt;br /&gt;
all state needed by the current ''aspect'' can be &amp;quot;committed&amp;quot; to the ''OpenGL'' driver.&lt;/div&gt;</summary>
		<author><name>wiki&gt;Jwilkins</name></author>
		
	</entry>
</feed>