_Q_ Posted April 29, 2015 Share Posted April 29, 2015 (edited) So I was searching of a way of implementing fog, something like silent hill effect, greatly educed visibilty of all object that are a little away from player.The options I found out would be using the clouds that show up when you zoom out, or using other screenwide widget with transparent imge.Thats why I was asking about shaders to add grain to it all and stuff like that. Any other ideas/options on this subject? PeterAI want to add fog like in silent hill for example.Is there a way of making custom shaders? Or other way that I can make fog effect? Edited April 30, 2015 by _Q_ Link to comment Share on other sites More sharing options...
TheShankingTurtle Posted April 29, 2015 Share Posted April 29, 2015 spooky occasional noises Link to comment Share on other sites More sharing options...
chromiumboy Posted May 1, 2015 Share Posted May 1, 2015 A low tech solution could be that you create three or so screen overlays for the player huds with a foggy looking texture and have them move around a little, independently of one another. Link to comment Share on other sites More sharing options...
_Q_ Posted May 1, 2015 Author Share Posted May 1, 2015 A low tech solution could be that you create three or so screen overlays for the player huds with a foggy looking texture and have them move around a little, independently of one another. With the current cloud thing on overlay one is enough since its animated, I think I can make it appear slowly with changing it alpha value over some time, but that seems far from perfect.Hawing the grain effect shader or maybe some other particle effect would look much better. Link to comment Share on other sites More sharing options...
Developer PeterA Posted May 1, 2015 Developer Share Posted May 1, 2015 Hey @_Q_, I don't know of any modders that have compiled their own shader, but the DS Mod Tools does ship with ShaderCompiler.exe on Windows (Steam\SteamApps\common\Don't Starve Mod Tools\mod_tools\tools\bin). I believe the command line parameters to compile a shader would beShaderCompiler.exe -little "creep" "PosUV_WorldPos.vs" "creep.ps" "creep.ksh" -oglslI believe you should be able to manually extract the .vs and .ps files from the .ksh files in data/shaders. If you take a look at rain.lua or mistparticle.lua you can see an example of how to hook up a shader to a particle emitter. Good luck, and let me know if you run into any problems. Edit: I looked into it a little bit further and there doesn't appear to be a generic way to set shader constant parameters from lua. One possibility would be to do something similar to the effect in heatover.lua, and send your parameters in via SetEffectParams, which takes 4 floats. Link to comment Share on other sites More sharing options...
_Q_ Posted May 1, 2015 Author Share Posted May 1, 2015 I'm having mad ideas about shaders, not only fog, but making all DS/DST use cell shading, so it would look quite different. Link to comment Share on other sites More sharing options...
Developer PeterA Posted May 1, 2015 Developer Share Posted May 1, 2015 Yeah @_Q_, I think you could do some pretty neat stuff with replacing the postfx shaders. Some techniques will be a little bit difficult because you won't have access to change the shader inputs, but I definitely look forward to what you can come up with! Link to comment Share on other sites More sharing options...
_Q_ Posted May 4, 2015 Author Share Posted May 4, 2015 Yeah @_Q_, I think you could do some pretty neat stuff with replacing the postfx shaders. Some techniques will be a little bit difficult because you won't have access to change the shader inputs, but I definitely look forward to what you can come up with! The ShaderCompiler.exe wont run cause it has missng DLL files:-missing cg.dll What did You meant by manually extracting vertex and pixel shader files from ksh files?I didn't find any extraction soft or commands, I may be missing something, its new stuff for me:D Link to comment Share on other sites More sharing options...
Developer PeterA Posted May 4, 2015 Developer Share Posted May 4, 2015 @_Q_, I've added the required dlls to the package now, so you should be able to run it now. What I meant by manually extracting the vertex and pixel shader files, is if you open the .ksh file in a text editor, you should see the code and files names for both the vertex and pixel shader. If you open anim.ksh, look for anim.vs, the vertex shader code will start 4 characters later with "uniform mat4 MatrixP;". Similarly further down you'll see anim.ps and the actual code starts with "#if defined( GL_ES )". Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now