Jump to content
  • entries
    944
  • comments
    5,899
  • views
    929,527

Multiple shaders in Vulkan


Josh

3,732 views

 Share

I have it worked out now where the new engine will handle multiple shaders. The renderer groups meshes (renamed from "surfaces" in Leadwerks) by shader. A single draw call renders many batches of instances, with different materials applied. It's a very advanced and complex system, so something that was simple before, changing the shader, now requires a lot of code to make work! You can see here the barbed wire is using an alpha-discard shader that removes pixels while the rest of the scene uses the normal default shader.

Untitled.thumb.jpg.269087376447b97b71c4dee779be5e3c.jpg

A new material file format will be implemented using the JSON data format. To indicate a shader in an existing Leadwerks material file for the new engine you can add a line of code like this to the file:

newshader = "Shaders/myshader.spv"

This will make it so the new engine can load the new shader, while the old engine will still see the old shader, in case you are using this in Leadwerks Editor.

Although this new system took a mountain of code to get working, I am starting to feel the tremendous power it offers. The Zone is now rendering 10x faster than it does in Leadwerks.

  • Like 2
 Share

4 Comments


Recommended Comments

What about doing something node based for shader creation like Unreal? 

 

I mean Yes yes, Unreal = Gian Development Team and Leadwerks = One dev Guy. The manpower is colossally different. Just hypothetically. Creating shader using nodes? For core game programming... NEVER xD but for shaders.... hmm

Link to comment
1 hour ago, TheConceptBoy said:

What about doing something node based for shader creation like Unreal? 

I mean Yes yes, Unreal = Gian Development Team and Leadwerks = One dev Guy. The manpower is colossally different. Just hypothetically. Creating shader using nodes? For core game programming... NEVER xD but for shaders.... hmm

I think the plugin / extension system in the new editor will be ideal for something like this. Just think, if I can make a sale to one of the big aerospace companies so that the program is installed on thousands of machines, if someone writes an extension that is truly useful they will have a built-in audience ready to buy it.

Link to comment
8 hours ago, Josh said:

I think the plugin / extension system in the new editor will be ideal for something like this. Just think, if I can make a sale to one of the big aerospace companies so that the program is installed on thousands of machines, if someone writes an extension that is truly useful they will have a built-in audience ready to buy it.

Smart move. 

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...