Basic material effects for rendering


#21

Ok, good to know. I also created a tool called SequenceImagePacker and checked it into my repo. Nothing fancy, it just packs same size image and packs it into a single image.

That’s been done before. See my offroad vehicle repo.


#22

I was using Leshy SpriteSheet Tool before and I made this reader if it is of any use: https://urho3d.prophpbb.com/topic2565.html. I hope your solution is better as I was stuck with this online tool as it generates a nice xml with all the offset especially if they are not linear.


#23

What I wrote is nothing like sprite sheet tool**. Because the sequence images are expected to be same size, you can calculate the UV offset if you know the number of rows, cols, and number of images packed in it. I guess that info should be shown at the end or output to a file.

Edit: ** and does not generate an XML file with packed info.
Edit2: only num rows and cols are required to calculate uv offset, num images to know when to terminate.


#24

Well, the vehicle demo is very complicated and it is hard to factor-out what I need - could you help me?


#25

#26

I was thinking of include fake BRDF shader in the next update, see pic. Is it too much?


#27

Thank you so much about Skid code sharing (ah, I now know how these are called!).
But how should I place them, where I do get parameters for AddStrip - is it from Raycast?
Which raycast (if that is from raycast) - physics or octree or some other?


#28

Now it’s time to study the offroad vehicle and see how they’re placed. In that repo, I called it WheelTrackModel.


#29

Thanks, that will come for later when I will understand the demo.
For now I will make a fountain… :slight_smile:


#30

Is a fake BRDF really needed since there is a real BRDF in the engine, and performance of the BRDF should be very good to the point where given mobile moves to gles3 (or hack it into gles2) as an options then it would work there without any problems


#31

Your work on PBR is excellent and I love what you done with it, and I’m sure it’s something that all would use if going for realism. What fake BRDF offers is a non-realistic rendering that you couldn’t achieve with PBR. Sticking with the mushroom example, take a look at the image 1 below. A is using normal diff mat and B is fakeBRDF, which is achieved by using image 2. Trying to get the effect B using a real BRDF would probably be… I don’t even know if it’s possible. By simply mixing random gradient colors you can achieve some really cool effect and it might be useful for some ppl and their game.

Image 1

Image 2


#32

OMG thanks for share…

God Bless You so much…


#33

My attempt at post process blur, pic below. I’ll update my repo with all that you see here in a day or two.

edit: changed the pic again to a better one and to demonstrate that only the masked section on the mesh gets blurred.


#34

What fake BRDF offers is a non-realistic rendering that you couldn’t achieve with PBR. Sticking with the mushroom example, take a look at the image 1 below. A is using normal diff mat and B is fakeBRDF, which is achieved by using image 2. Trying to get the effect B using a real BRDF would probably be… I don’t even know if it’s possible. By simply mixing random gradient colors you can achieve some really cool effect and it might be useful for some ppl and their game.

I agree as someone whose project doesn’t aim for photo-realism. That image B is kind of fantastic considering the mesh you’re using.


#35

PBR doesnt mean realism, it just happens to makes it easier to be realistic by allowed artists to get more accurate metallics and mate materials with less work. It is easily possible to be artistic and stylisised.

That result would likely be possible by using a custom cubemap on a low roughness material in PBR. Although id have to test.


#36

I have no doubt you will be able to do it, but us layman who are not all that graphics programming savvy would probably have trouble :sweat:


#37

PBR doesnt mean realism, it just happens to makes it easier to be realistic by allowed artists to get more accurate metallics and mate materials with less work.

This is a good chance to ask you what the intention of the PBR renderer implemented in Urho is, then. Although I understand the concept itself loosely, it also seems to be a loosely defined concept in general from the reading I’ve done on it, and as I’m still a novice when it comes to graphics programming, looking at the code only helps me use and extend it, not understand it completely at this point. As far as I could tell, the single common aim for PBR was realistic light simulation. As this is a more general principal, I imagined there was an unnecessary overhead inherent in its use when we could simplify the desired effects for style, and wrestling to refit the PBR pipeline into all other use-cases would be inefficient. I’d love it if you could demystify this for me. :smile:

It is easily possible to be artistic and stylisised.

Of course.


How to draw using inbuilt primitives?
#38

Wrapped up the project and checked everything in on the repo. A ton of files deleted and replaced, so I might have missed some. Let me know if something’s missing, thx.

What’s new:
-per object, per emissive mask post process glow
-fake BRDF
-all 500+ sequence frame images, i.e. fire, explosion, etc., were deleted packed into a single files
-several new shaders added for both glsl and hlsl
-uv sequencer class to handle updates
etc. etc.

edit: update the post process glow.xml

vid


#39

The key is in the name, Physically Based. The whole idea behind PBR is to base material inputs on real world and observable values. This makes it easier for artists to create materials that resemble the real world as they can just look up values, for example most metallic objects have 1 metallic (because there metal) and 1 smoothness (because the microsurface is smooth) and then you just input the RGB and your away, you can then add increased detail to the material through changes in the roughness and metallic maps to simulate paint and scratches. The overall advantage, in that case it is easier to be more accurate and more detailed in materials.

One of the best benefits to PBR is it allowed for metallic objects that look metallic. In reallity metallic objects tends to have really dark diffuses with a lot of that color going into the specular (hence a the specular is tinted). They also reflect most of the incoming light. In traditional renderers the closest they would get was a tinted specular and a high specularity.

None PBR:

Compare the metal of the skyhook in Bioshock infinite to an stylised PBR object that uses metal:

Another benefit of PBR is that due to it relying on environmental lighting from reflection techniques such as cubemaps it allows materials to render in many diffrent lighting environments with no changes to the textures. In traditional materials it was common to change the diffuse color based on the environment you placed the object, but in PBR the shader handles all that for you .

Overall it just allowed more control over materials allowing developers to hit higher quality with less effort and allows engines to render a wider range of materials with no changes across a wider range of environments in addition to very little performance overhead compared to traditional rendering. There is likely many other benefits i have not mentioned. But the short of it is once PBR is implemented there is not really a need to use traditional rendering as PBR can do all that and do more whilst giving a quality boost in the process, hence why larger engines completely replaced there material pipeline with PBR,


#40

I appreciate you taking the time to explain that and I think I understand what you’re saying. To me the name physically based rendering did imply a pursuit of simulating physical properties, and I’m not sure any of what you said counters that, to be honest, but at the same time I can imagine there is the possibility and I simply haven’t seen it yet. The stylized book you reference, for example, kind of demonstrates what I mean – style isn’t limited to just more or less “cartoony” geometry.

As for the cost of PBR when trying to do complex scenes, which is my true concern, I saw this render below a while back, and it is perhaps the type of thing I’m thinking of when I doubt PBR as a be-all-end-all. Meaning, fantastical scenes.