Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

shader about cone sight

I have a question that I want make enemy cone sight.

alt text

alt text

alt text

I found an approximate solution.But it's Unity. its:https://answers.unity.com/questions/947748/true-cone-of-sight-commandos.html

So,Can someone help me implement it in UE4? I dont know shader. Shader Code:

struct appdata { float4 vertex : POSITION; float3 normal : NORMAL; }

struct v2f { float4 uvShadow : TEXCOORD0; float4 uvFalloff : TEXCOORD1; float4 pos : SV_POSITION; float3 norm : NORMAL; };

v2f vert (appdata i) { v2f o; o.pos = mul (UNITY_MATRIX_MVP, i.vertex); o.uvShadow = mul (_Projector, i.vertex); o.uvFalloff = mul (_ProjectorClip, i.vertex); o.normal = i.normal; return o; }

fixed4 frag (v2f i) : SV_Target { fixed4 texS = tex2Dproj (_ShadowTex, UNITY_PROJ_COORD(i.uvShadow)); texS.a = 1.0-texS.a; fixed4 texF = tex2Dproj (_FalloffTex, UNITY_PROJ_COORD(i.uvFalloff)); fixed4 res; // assume Y is up if(dot(i.normal, float3(0,1,0)) >= 0.9) { res = lerp(fixed4(1,1,1,0), texS, texF.a); } else { res = texS; } return res; }

Product Version: Not Selected
more ▼

asked May 03 '19 at 09:49 AM in Using UE4

avatar image

13 1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first
more ▼

answered May 03 '19 at 01:45 PM

avatar image


(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question