1"use strict";(self.webpackChunkvrm_dev=self.webpackChunkvrm_dev||[]).push([[4280],{28293:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>o,contentTitle:()=>l,default:()=>c,frontMatter:()=>s,metadata:()=>n,toc:()=>d});const n=JSON.parse('{"id":"api/material/texture_manipulation","title":"Texture\u95a2\u9023","description":"Unity \u306e linear \u306e \u30c6\u30af\u30b9\u30c1\u30e3\u30fc\u306e\u6319\u52d5\u306b\u3064\u3044\u3066","source":"@site/docs/api/material/texture_manipulation.md","sourceDirName":"api/material","slug":"/api/material/texture_manipulation","permalink":"/api/material/texture_manipulation","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{},"sidebar":"apiSidebar","previous":{"title":"v0.76 ITextureDeserializer(\u30c6\u30af\u30b9\u30c1\u30e3\u30fc\u30ed\u30fc\u30c0\u30fc)","permalink":"/api/material/0_76_texture_deserializer"},"next":{"title":"UnlitTransparentZWrite","permalink":"/api/material/transparent_zwrite"}}');var a=r(74848),i=r(28453);const s={},l="Texture\u95a2\u9023",o={},d=[{value:"Unity \u306e linear \u306e \u30c6\u30af\u30b9\u30c1\u30e3\u30fc\u306e\u6319\u52d5\u306b\u3064\u3044\u3066",id:"unity-\u306e-linear-\u306e-\u30c6\u30af\u30b9\u30c1\u30e3\u30fc\u306e\u6319\u52d5\u306b\u3064\u3044\u3066",level:2},{value:"Runtime",id:"runtime",level:3},{value:"Editor(Asset)",id:"editorasset",level:3},{value:"Unity \u306e NormalMap \u306e\u6319\u52d5\u306b\u3064\u3044\u3066",id:"unity-\u306e-normalmap-\u306e\u6319\u52d5\u306b\u3064\u3044\u3066",level:2},{value:"Runtime",id:"runtime-1",level:3},{value:"Editor(Asset)",id:"editorasset-1",level:3}];function u(e){const t={blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.header,{children:(0,a.jsx)(t.h1,{id:"texture\u95a2\u9023",children:"Texture\u95a2\u9023"})}),"\n",(0,a.jsx)(t.h2,{id:"unity-\u306e-linear-\u306e-\u30c6\u30af\u30b9\u30c1\u30e3\u30fc\u306e\u6319\u52d5\u306b\u3064\u3044\u3066",children:"Unity \u306e linear \u306e \u30c6\u30af\u30b9\u30c1\u30e3\u30fc\u306e\u6319\u52d5\u306b\u3064\u3044\u3066"}),"\n",(0,a.jsx)(t.h3,{id:"runtime",children:"Runtime"}),"\n",(0,a.jsx)(t.p,{children:"new \u3059\u308b\u5834\u5408\u306f\u3001"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-csharp",children:"var texture = new Texture2D(width, height, format, mipChain, linear = true);\n"})}),"\n",(0,a.jsx)(t.p,{children:"\u3068\u3059\u308b\u3002"}),"\n",(0,a.jsx)(t.h3,{id:"editorasset",children:"Editor(Asset)"}),"\n",(0,a.jsx)(t.p,{children:"AssetFolder \u306e png/jpg \u304b\u3089load\u3059\u308b\u5834\u5408\u306f\u3001\n\u4e8b\u524d\u306b\u8a2d\u5b9a\u304c\u5fc5\u7528\u3002"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-csharp",children:"var textureImporter = AssetImporter.GetAtPath(assetPath) as TextureImporter;\ntextureImporter.sRGBTexture = false; // Linear\ntextureImporter.SaveAndReimport();\n\n// linear \u3067\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3059\nvar texture =AssetDatabase.LoadAssetAtPath<Texture2D>(assetPath);\n"})}),"\n",(0,a.jsx)(t.h2,{id:"unity-\u306e-normalmap-\u306e\u6319\u52d5\u306b\u3064\u3044\u3066",children:"Unity \u306e NormalMap \u306e\u6319\u52d5\u306b\u3064\u3044\u3066"}),"\n",(0,a.jsxs)(t.blockquote,{children:["\n",(0,a.jsx)(t.p,{children:"MToon \u306e NormalMap \u3082\u540c\u3058"}),"\n"]}),"\n",(0,a.jsx)(t.h3,{id:"runtime-1",children:"Runtime"}),"\n",(0,a.jsx)(t.p,{children:"new \u3059\u308b\u5834\u5408\u306f\u3001"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-csharp",children:"var texture = new Texture2D(width, height, format, mipChain, linear = true);\n"})}),"\n",(0,a.jsxs)(t.p,{children:["\u3068\u3059\u308b\u3002\n\u307e\u305f\u3001 ",(0,a.jsx)(t.code,{children:"DXT5nm"})," \u3068\u3044\u3046\u4ed5\u69d8\u3067\u683c\u7d0d\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u5909\u
163db\u3057\u307e\u3059\u3002\ny \u3068 w \u306e\uff12\u8981\u7d20\u3060\u3051\u3092\u4f7f\u3044\u307e\u3059\u3002"]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-hlsl",children:"half4 normal;\nnormal.x = 1.0;\nnormal.y = col.y;\nnormal.z = 1.0;\nnormal.w = col.x;\n"})}),"\n",(0,a.jsx)(t.h3,{id:"editorasset-1",children:"Editor(Asset)"}),"\n",(0,a.jsx)(t.p,{children:"AssetFolder \u306e png/jpg \u304b\u3089load\u3059\u308b\u5834\u5408\u306f\u3001\n\u30ed\u30fc\u30c9\u3059\u308b\u524d\u306b\u8a2d\u5b9a\u304c\u5fc5\u7528\u3002"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-csharp",children:"var textureImporter = AssetImporter.GetAtPath(assetPath) as TextureImporter;\ntextureImporter.textureType = TextureImporterType.NormalMap; // normalMap\ntextureImporter.SaveAndReimport();\n\n// DXT5nm \u3067\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3059\u3002\nvar texture =AssetDatabase.LoadAssetAtPath<Texture2D>(assetPath);\n"})})]})}function c(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(u,{...e})}):u(e)}},28453:(e,t,r)=>{r.d(t,{R:()=>s,x:()=>l});var n=r(96540);const a={},i=n.createContext(a);function s(e){const t=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:s(e.components),n.createElement(i.Provider,{value:t},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.