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"

How do I render a mesh using a custom set of shaders?

Hi there,

I am looking for some tips on how I would go about rendering a mesh that has the following rendering process:

  • Dummy vertex shader (Does nothing)

  • Hull and Domain shaders - Generates a series of isolines from a buffer provided by me

  • Geometry shader - Takes the isolines and generates geometry

  • Pixel Shader - renders the geometry.

So essentially I dont provide a vertex buffer or index buffer or an input layout, all vertex data is generated on the GPU based on some data I provide. This seems to go against the Vertex Factory approach (Which expects FVertexFactoryInput to have some data - Unless i can set that to blank), also DrawMesh does not allow me to specify zero primitives (I only need to set the number of vertices).

Is it possible to render the mesh without using a Vertex Factory, but defining the shaders I require, while still remaining with the Deferred rendering pipeline? For now I am not too worried about being able to apply a Material to this mesh, in the end I will only need a base colour. I will provide the normals and such.

If it can be avoided I don't want to have to modify the BasePass shaders or the MaterialTemplate shaders. As the plan is to distribute this as a plugin eventually, I want to keep my modifications of other shaders to a minimum.

Will this actually be possible from a plugin? Or should I just modify the engine to do this.

Please ask any questions, as Im not sure if I have explained well enough what I am trying to achieve.

Product Version: Not Selected
more ▼

asked May 13 '14 at 12:44 AM in C++ Programming

avatar image

1.5k 50 9 59

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

1 answer: sort voted first

I have managed to solve this by not using a vertex factory and setting the shaders and such myself.

more ▼

answered May 13 '14 at 03:06 PM

avatar image

1.5k 50 9 59

avatar image dekrat Dec 11 '14 at 03:30 AM

Could you share some code that demonstrates a basic pipeline of using custom shaders? I haven't found any official documentation that is good enough to get me started.

avatar image P2ssw0rd Feb 17 '15 at 11:17 AM

Yes, could you share knowledge by sample from vertex -> hull -> tessellator -> domain -> geom -> pixel shader. ?

I found this: https://github.com/Temaran/UE4ShaderPluginDemo

avatar image darkgaze Mar 26 '18 at 05:31 PM

I discovered that pixel and vertex shaders can be done via the material editor, after a looooong long time of research on all documenation and forums I could find. Seems like doing it by hand is not always possible.... not as easy as creating a simple hsls shader for pixel and vertex shaders and asigning them to a material, like you do in Unity in two clicks. You can even see the HSLS code generated in the material editor (windows -> HLSL code window)...

In fact, everybody talks about pixel shaders in the material editor, but using "World Position Offset" plug on it lets you modify the vertices too... using the UV coordinates. Lucky the one who can figure out a way to pass per-vertex data to it!

(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