x

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"

Custom material in C++

Hello,

I have a custom shader/material question I cannot seem to find an answer to. Basically, I have three shaders - vertex, geometry and pixel. I also have geometry I need to render using these shaders. I get to the point where I am calling FPrimitiveDrawInterface::DrawMesh - however, the 'FMeshBatch' expects a FMaterialRenderProxy* parameter to be set that I would expect to contain those shaders I need. What I need to know is: how to create a custom FMaterial (or whatever) from my shaders?

I only found two questions on this site to this topic and none really answered the question I have so I am trying to post my own to get a definitive answer. Thanks in advance for any input!

Product Version: Not Selected
Tags:
more ▼

asked Jan 07 '15 at 05:21 AM in Rendering

avatar image

ananta
1 1 2 2

avatar image lion032 Jul 02 '15 at 06:11 AM

Have you found a solution to your problem?

avatar image ananta Jul 02 '15 at 06:25 AM

Nope,. I have long since switched to Unity 5 that makes it trivial to write such custom rendering paths

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

1 answer: sort voted first

Unreal only provides graph material editing unlike text for that Unity have, but both just add to deeper more complex shader system that engine habe. if you want to add any shader code in UE4 you need to write usf file and some C++ code to control it, but ofcorse this won't avoid you to make material.

https://www.unrealengine.com/en-US/blog/how-to-add-global-shaders-to-ue4

Material editor also provides code node allowing to add the code

https://docs.unrealengine.com/en-us/Engine/Rendering/Materials/ExpressionReference/Custom

Not ot mention you can just make graph doing exact same thing as your shader code, all code material graph is converted to HLSL code so there is no performance impact. Only downside of using material graph is lack of ability to loop and fact you are limited to nodes that there is.

more ▼

answered Jul 04 '18 at 08:23 PM

avatar image

Shadowriver
36.7k 932 169 1111

avatar image Deadly_kom Jul 04 '18 at 08:36 PM

Thanks for the reply, but I know it is so, better to read what is written in the first post

avatar image Shadowriver Jul 05 '18 at 12:49 AM

I just replaying to main question :p

(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