New answers tagged

0

The unity standard assets contains a projector game object, material, and shader. Just drag into your scene, reposition, drag material into projector, and drag image into shader “cookie” field.


0

Be sure you have something like this in your code: Game(1) { Content.RootDirectory = "Content"; sContent = Content; } In the book "Learn 2D Game Development with C#" on page 43 they left that out.


0

Well, for my bullet hole shader I find the issue to remove the transparent alpha effect by changing my "Blend" with your "Blend OneMinusSrcAlpha SrcAlpha". // Upgrade NOTE: replaced '_Projector' with 'unity_Projector' // Upgrade NOTE: replaced '_ProjectorClip' with 'unity_ProjectorClip' Shader "Projector/Multiply" { Properties { _ShadowTex ("...


0

For just converting Image's sprite To Texture use this: Image.sprite.texture And this will do the Job. Thanks @virtouso for sharing the thread.


1

// assume "sprite" is your Sprite object var croppedTexture = new Texture2D( (int)sprite.rect.width, (int)sprite.rect.height ); var pixels = sprite.texture.GetPixels( (int)sprite.textureRect.x, (int)sprite.textureRect.y, (int)sprite.textureRect.width, ...


0

DX_DContext->UpdateSubresource( arrTex.Get(), i, nullptr, arr, mapped.RowPitch, mapped.DepthPitch); subresource parameter was wrong. a subresource is actually combination of mipmap level and array element. so we can use the formula 'curArrayelementIdx*totalmiplevel + curmiplevel' or d3d11calcsubresource


Top 50 recent answers are included