thexa4 / source-pbr Goto Github PK
View Code? Open in Web Editor NEWSource Engine Physically Based Rendering implementation
Home Page: https://wiki.empiresmod.com/PBR
License: Other
Source Engine Physically Based Rendering implementation
Home Page: https://wiki.empiresmod.com/PBR
License: Other
SOURCE 1 SDK LICENSE Source SDK Copyright(c) Valve Corp. THIS DOCUMENT DESCRIBES A CONTRACT BETWEEN YOU AND VALVE CORPORATION ("Valve"). PLEASE READ IT BEFORE DOWNLOADING OR USING THE SOURCE ENGINE SDK ("SDK"). BY DOWNLOADING AND/OR USING THE SOURCE ENGINE SDK YOU ACCEPT THIS LICENSE. IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE PLEASE DON’T DOWNLOAD OR USE THE SDK. You may, free of charge, download and use the SDK to develop a modified Valve game running on the Source engine. You may distribute your modified Valve game in source and object code form, but only for free. Terms of use for Valve games are found in the Steam Subscriber Agreement located here: http://store.steampowered.com/subscriber_agreement/ You may copy, modify, and distribute the SDK and any modifications you make to the SDK in source and object code form, but only for free. Any distribution of this SDK must include this LICENSE file and thirdpartylegalnotices.txt. Any distribution of the SDK or a substantial portion of the SDK must include the above copyright notice and the following: DISCLAIMER OF WARRANTIES. THE SOURCE SDK AND ANY OTHER MATERIAL DOWNLOADED BY LICENSEE IS PROVIDED "AS IS". VALVE AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES WITH RESPECT TO THE SDK, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT, TITLE AND FITNESS FOR A PARTICULAR PURPOSE. LIMITATION OF LIABILITY. IN NO EVENT SHALL VALVE OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THE ENGINE AND/OR THE SDK, EVEN IF VALVE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. If you would like to use the SDK for a commercial purpose, please contact Valve at [email protected].
game always crash when load a map
I've had this bug for a while, completely unsure as to what it could be.
Whenever a projectedtexture is cast from a relatively far distance onto a model, it seems to render the model at max brightness no matter what the actual lamp's brightness value is.
Examples:
update: OK, it seems to be an issue regarding the FarZ of the projectedtexture. By the looks of it, the shader doesn't account for possible loss in brightness when the lamp is cast from far away with a high FarZ value, instead what I think it does is take the default FarZ value of 1024 and keeps the brightness from that value meaning it doesn't update with the changes to the FarZ value.
Which explains as to why projectedtextures look absolutely fine from up close (player flashlights), but seem to mess up once the projectedtexture is casted from far away.
$basetexturetransform is nonfunctional, it doesn't seem to do anything to the basetexture.
Where does this iEnvMapLOD comes from
hi there!
the $useparallax to 1, is not working.
neither on models or brushes, do you know why? and how to get this fixed.
any help would be so much appreciated, because there is no Parallax is any open source, only outdated ones.
i really need parallax to work, that would be a dream.
"$useparallax" "1"
"$parallaxdepth" "600" (to see if there is any different changes)
"$parallaxcenter" "1"
thank you for making this!!!
and thank you for reading.
It crashes when you do mat_reloadallmaterials
The reason is that Source 2013SP does not support registers higher than c31
while this shader uses hardcoded c40
.
Changing it to generally free c27
fixes everything.
when trying to build the game on Windows 10, I get this error in the build:
'3>d:\game projects\source sdk 2013 pbr\mp\src\materialsystem\stdshaders\pbr_dx9.cpp(251): error C2039: 'SetUSEENVAMBIENT' : is not a member of 'pbr_ps30_Static_Index'
3> d:\game projects\source sdk 2013 pbr\mp\src\materialsystem\stdshaders\fxctmp9\pbr_ps30.inc(3) : see declaration of 'pbr_ps30_Static_Index'
3>d:\game projects\source sdk 2013 pbr\mp\src\materialsystem\stdshaders\pbr_dx9.cpp(252): error C2039: 'SetEMISSIVE' : is not a member of 'pbr_ps30_Static_Index'
3> d:\game projects\source sdk 2013 pbr\mp\src\materialsystem\stdshaders\fxctmp9\pbr_ps30.inc(3) : see declaration of 'pbr_ps30_Static_Index'
3>d:\game projects\source sdk 2013 pbr\mp\src\materialsystem\stdshaders\pbr_dx9.cpp(253): error C2065: 'psh_forgot_to_set_static_CONVERT_TO_SRGB' : undeclared identifier'
I have successfully built the official SDK before, so I know that my config is not an issue.
As described in the title, the prop_physics
entities lose their color data when they are not moving.
On the left is model with $CollisionModel
added, and on the right is a model without collision:
(tested on two different maps with correct lighting and cubemaps)
pbr_ps20b 3 ERROR(S):
error X4018: Shader uses texture addressing operations in a dependency chain that is too complex for the target shader model (ps_2_b) to handle.
Reported 3360 time(s), example command:
fxc /DCENTROIDMASK=0 /DSHADERCOMBO=3bff /DSHADER_MODEL_PS_2_B=1 /Tps_2_b /Emain /DWRITEWATERFOGTODESTALPHA=1 /DPIXELFOGTYPE=1 /DNUM_LIGHTS=4 /DWRITE_DEPTH_TO_DESTALPHA=1 /DFLASHLIGHTSHADOWS=1 /DFLASHLIGHT=1 /DFLASHLIGHTDEPTHFILTERMODE=2 /DLIGHTMAPPED=1 /DUSEENVAMBIENT=1 /DEMISSIVE=1 /DSPECULAR=1 /DPARALLAXOCCLUSION=1 pbr_ps30.fxc
pbr_common_ps2_3_x.h(61,19-25): error X4532: cannot map expression to pixel shader instruction set
Reported 240 time(s), example command:
fxc /DCENTROIDMASK=0 /DSHADERCOMBO=1c43 /DSHADER_MODEL_PS_2_B=1 /Tps_2_b /Emain /DWRITEWATERFOGTODESTALPHA=1 /DPIXELFOGTYPE=1 /DNUM_LIGHTS=3 /DWRITE_DEPTH_TO_DESTALPHA=1 /DFLASHLIGHTSHADOWS=0 /DFLASHLIGHT=0 /DFLASHLIGHTDEPTHFILTERMODE=0 /DLIGHTMAPPED=1 /DUSEENVAMBIENT=1 /DEMISSIVE=1 /DSPECULAR=1 /DPARALLAXOCCLUSION=0 pbr_ps30.fxc
pbr_common_ps2_3_x.h(59,18-23): error X4532: cannot map expression to pixel shader instruction set
Reported 3120 time(s), example command:
fxc /DCENTROIDMASK=0 /DSHADERCOMBO=1dff /DSHADER_MODEL_PS_2_B=1 /Tps_2_b /Emain /DWRITEWATERFOGTODESTALPHA=1 /DPIXELFOGTYPE=1 /DNUM_LIGHTS=4 /DWRITE_DEPTH_TO_DESTALPHA=1 /DFLASHLIGHTSHADOWS=1 /DFLASHLIGHT=1 /DFLASHLIGHTDEPTHFILTERMODE=2 /DLIGHTMAPPED=1 /DUSEENVAMBIENT=1 /DEMISSIVE=1 /DSPECULAR=1 /DPARALLAXOCCLUSION=0 pbr_ps30.fxc
FAILED: pbr_ps20b
4 minutes, 4 seconds elapsed
07:31 PM
Press any key to continue . . .
get this on source sdk 2013 multiplayer shader compile.
Hey. I tried to transfer your PBR to my project with a few corrections. Everything was successfully compiled. The game complains of an error and does not show the texture. Materials for PBR prepared.
Houston we have a problem. Bumpmap does not want to work on the new shader. What the problem is is not clear.
Checked both $normaltexture and $bumpmap. Nothing works. Models remain smooth.
Hi,
The shader does really well except for when using the flashlight on a model. At certain angles, the lighting on the model seems to change to only be the flashlight or something? It's believed that perhaps the lighting origin is changing for the model. Not sure what's up.
Here's a gfycat of it happening:
https://gfycat.com/adorablepassionatechipmunk
It doesn't have some methods like:
" SetModulationPixelShaderDynamicState_LinearColorSpace"
"pShaderAPI->SetPixelShaderStateAmbientLightCube"
...
When shining a light (flashlight typically), on any model that uses $alphatest; causes the model to not take light properly-even without the flashlight. Below are two images; one with the alpha on, and the other off.
You can see how the light affects the one with it off, as a model typically should look if a light is shined on it. Puzzled as to why this is the case, below are the VMT parameters for the Body, cape isn't any different.
"PBR"
{
"$basetexture" "models/souls/ds3/c1280/var1_body_a"
"$bumpmap" "models/souls/ds3/c1280/var1_body_n"
"$mraotexture" "models/souls/ds3/c1280/var1_body_mrao"
"$speculartexture" "models/souls/ds3/c1280/var1_body_r"
"$envmap" "env_cubemap"
"$surfaceprop" "metal"
"$model" "1"
"$alphatest" "1"
"$alphatestreference" "0.6"
}
Creating a large pack with this shader would be beneficial for Garry's Mod, especially if it garners a lot of attention. Issues with lighting regarding the $alphatest, are problematic; personally, I'm not sure if there's ways around this that I'm not aware of. When the pack is uploaded, I'll provide a link here should it gather a large group of people; maybe then, Rubat might actually make it required--if he sees a real need for it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.