Basic material effects for rendering


#1

Basic material and techniques for rendering effects, which might be useful for individuals new to Urho3D.

repo: https://github.com/Lumak/Urho3D-Material-Effects/

recently added: https://github.com/Lumak/Urho3D-Greenscreen-UVFrame

Let me know if I missed any files in my check-in. Thx.


#2

screenshot with fire


#3

added lava


#4

That is great! Thank you very much for sharing this.


#5

Glad you like it.

I’m learning as I go, as I never really delved into graphics or shaders. Most likely, I’ll consolidate some of the functionalities currently on the CPU to shaders.


#6

Looks like MaterialEffects/Textures/checkers-lightmap.png is missing, which is used in MaterialEffects/Materials/sphLightMapMat.xml. There are checkers-lightmap001.png and checkers-lightmap002.png though.
And in MaterialEffects/Level1.xml, the material is redMat.xml, but the actual file name is RedMat.xml.

And some paths are hard coded, e.g., loading the Level1.xml.

I build and run it and the effects look amazing. :grin:


#7

ok, thx fixed those isses - repo updated.
The absolute path is required when passing a File, thought. At least for me on Windows.

And lastly, fixed the UnlistAlphaMask shader to remove black edges.


#8

These are awesome! Thanks for the share!


#9

You’re welcome.

Added waterfall and waterdiff shader, you can add a diff material to it.


#10

Looks like WaterNoise.dds is missing


#11

That’s part of Urho3D distribution and should be in the Data/Textures folder.

Can you give me some feedback on my new water shader? Thx.


#12

These have all saved me a good chunk of time, thanks. The water shader is good. I think with ripples, waves, and foam I’d personally be set :grin:.

Edit: considering the style, even just foam would be enough to make it “polished” enough to use.


#13

Thank you so much! This is what I missed. I wonder if it is possible to include these with Urho…


#14

@suncaller good to hear.
@slapin you’re welcome, I doubt I’ll write scripts for the things that I do - it’s too much work but perhaps someone else can.
@yushli1 ok, changed the absolute path.

Update: completed the glsl/hlsl water shaders. There are two versions: 1) WaterDiff - reflective/refractive w/ bump and diff texture, 2) WaterDiffAlpha - same as 1 but w/ alpha.

Also added watersplash(ripple) when char is in run anim - edit:fixed.


#15

Latest image of of the wave after groundwatermat updated.

Ok, last one. added a water mat waterGroundSandMat.xml with a new normal text. pic:


#16

Nice! If you use sprite-sheets it might improve the performance a bit.


#17

Great minds think alike :slight_smile:, as I was just looking into doing that. I haven’t used the packer tool yet, but just from looking at the code I might have to extend the options to make it easier load ~100 input files.


#18

I took some time to rewrite the packer tool and was able to pack the explosion sequence images into a single file w/o any problems, see below. However, eventhough it’s just a straight copy, closer look of the result images show pixelation, see img 2.

This is not going to work.

Img 1

Img 2

Edit: discovered that saving the image as JPG w/ quality = 100 preserved the quality and results in no pixelation.


#19

You can also using image magic for packing http://acamara.es/blog/2012/12/assembling-sprite-sheets-with-imagemagick/

https://github.com/urho3d/Urho3D/issues/1394


#20

Request: Is it possible to add example of leaving vehicle traces on road (when braking or sliding)?