<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>koturn</author_name>
  <author_url>https://blog.hatena.ne.jp/koturn/</author_url>
  <blog_title>koturnの日記</blog_title>
  <blog_url>https://koturn.hatenablog.com/</blog_url>
  <categories>
    <anon>Unity</anon>
    <anon>Shader</anon>
  </categories>
  <description>シェーダーにおいて，組み込み関数である normalize() にゼロベクトルを渡した場合，NaN になる． 正規化ベクトルの定義からも当然である． \begin{equation} normalize(\boldsymbol{v}) = \dfrac{\boldsymbol{v}}{\| \boldsymbol{v} \|} \end{equation} シェーダーとしては normalize() は下記の実装と同等である． float3 を一例としているが，float2 や float4 等でも同様である． float3 normalize(float3 v) { return rsqrt…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkoturn.hatenablog.com%2Fentry%2F2022%2F12%2F23%2F050000&quot; title=&quot;シェーダーにおけるゼロベクトルの正規化 - koturnの日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-12-23 05:00:00</published>
  <title>シェーダーにおけるゼロベクトルの正規化</title>
  <type>rich</type>
  <url>https://koturn.hatenablog.com/entry/2022/12/23/050000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
