PBR Principale Node with Light Data Node

How does it come he has those 2 input ?

Im looking forward using Lamp Data in a pbr setup

I think it was merely a test build.

image

1 Like

this testing version, if you need get PBR material and specular color - in cycles render add Principal BSDF shader - in upbge use node and connect - lamp data node to BSDF(color in color, light vector to normal) and connect BSDF output to material node. Cycles outputs not support for game in version 0.2.5 surface, displacement, volumetric not work in game in v.


0.2.5

1 Like

Yeah, that was a test i did but it has issues that i couldn’t resolve with more than 1 light.

1 Like

i see, it’s possible to sum many light data when it’s about a simple distance (vertex - light)

But here you are willing to use the position of the light source to compute a bouncing vector (reflection)

Did you try to play with the shadow output ? Even if its not a vector , the result on the material takes also into account the light position (and not simply the distance like the “Visibility Factor” or “Distance” do )

i don’t understand what you are doing here . I tried to setup like u did , but i see nothing changing on Cube/sphere

to use my setup, the first thing is to turn on the node of the material in UPBGE mode, the material and its final output will appear in your node window - you need to specify the material assigned to your object, then switch to cycle mode and find the Principle BSDF in the shaders. This is essentially the main shader for materials with it you can create a metal, fabric or plastic material - just adjust the values in the shader itself - or add a texture node altogether from cycles - hen you can simply assign PBR material textures and get better materials. A little advice if you decide to make a game with PBR materials with the same materials, color objects without baking normal maps and diffuse maps - firstly, this is not the necessary procedure for you and so PBR materials with all texture maps and secondly, BGE/UPBGE handles the materials collected in the node editor better than texture slots - in this way I got 3.5-3.8 million polygons with 50-57 FPS in the scene.

if you can’t assemble it in the node editor, let me know - I’ll just send you the file.

@Villi89 I think you’re confusing the internal, UPBGE 0.2x Diffuse & Specular Shader Models with the Cycles Principled BDSF Node. They’re not related, contrary to false rumors and wishful thinking.

While the Cycles PBR node may work initially at runtime, visual changes are not updated dynamically and are only static.

1 Like

Why do you think so? if you connect these lamps correctly, for example, the PBR node will show the correct specular shine, the same applies to the matte metal material. In general, most nodes work well in UPBGE and give such effects that texture slots will not give. And it shows a specular because it passes through the node of the object’s material - if you connect it directly to the output of the material, then the speculator, and the correct shading will disappear

I don’t remember well and i don’t have that code in my current computer. I think it wasn’t an issue about the sum of the light data (it is not hard). I remember that it was an issue to get data from other lights but i don’t remember well.

you don’t need to explain me how to make a material setup lol … i was saying that your material setup is doing nothing interesting (unless i’ve miss something or did something wrong)

Maybe post a video or upload the file ?

test_pbr_mat.blend (96.1 KB)

1 Like

yes i see , but i don’t see how the lamp data fakes anything dynamic . You had even put it aside in your file

The lamp has to get its “diffuse” and “specular” off to make it a fake light source (the point behind this is that without diffuse and specular, the lamp doesnt uses CPU )

I’m looking for a material that would reflect fake lamps when amid them

EDIT : it’s possible to use lamp data to provide the emission/diffuse input. But it doesn’t render well a light effect since there’s no “self- shadowing” . The effect applies uniformly , so it renders like some subsurface

heres a basic setup for generating a light-like effect on a material, ill need some extra time to make a demo blend. its configured to create lights relative to the object the material is on. basic diffuse and specular result.

maybe this post help for solution you problem

can’t wait to see it running . Looking forward for it

i’m only interested in game-oriented solutions. I’ve tested a couple of days ago, some cubemapping reflections material on my character , but since my scene is not a simple cube on a plane, the fps get killed ( maybe i did miss a checkbox ?)

we need to make upbge able to handle settings of a real game with a good fps by finding how to cheat/trick to cope with upbge’s limitations. Upbge should become a game engine, not some realtime material render.

Illustration

this is the best i can get so far . As everyone can see, Spheres are the best objects to demo some material as the result “cannot be wrong” ( That’s why it angers me to see all those demo tech demos bragging on how marvelous the result looks like , but without considering that a game is not about just displaying some balls on a plane)

So, it looks like my fake lamp (no diffuse, no specular) is perfectly reproducing the 1/d² light magnitude on the Sphere … but on the monkey, light doesn’t seems to produce some surface effect but some internal fusion heat ( like subsurface) due to no shadows ( spheres have no self-lighting occlusion ofc)

So i wonder what could be done to improve the result on complex objects. Fresnel ? It seems that except : " Color " , " Color Intensity " , “Ambiant " and " Emit” , all the other inputs have no effects

All this is made for the sake of sparing CPU ressources, i don’t know if material nodes could be even heavier than dealing with real lamps .


With the lamp having diffuse and specular on

diffuse off

diffuse on

its a bit strange, with no other light source, how can we still distinguish the monkey’s eye when the Diffuse is off ? Like, there’s a tiny bit of ambient occlusion


Is there any AO mapping technique that would work like Normals ?

image

Does this output work on the Lamp Data ?

image

Is there already anything in UPBGE that would use some “dynamic” shadow map for objects that move around light sources ? For instance, we can bake AO, Normals, Shadows … etc on static objects, but for dynamic objects (the characters) , i would like to fake soft shadows thx to lamp data node

i know what normals are supposed to do, but i don’t really know how they are used/computed .

Here, i use an AO map to control the color intensity , but the occlusion effect is washed away by the proximity of the fake lamp .

Now i wonder how the lamp data vector coupled with a mapped normals (here just showing with the AO texture) could improve the result

sorry if say/ask silly things :grimacing: