Author Topic: New CRT-style shader & questions about provided uniforms  (Read 4708 times)

Offline somnolik

  • Squaddie
  • *
  • Posts: 1
    • View Profile
New CRT-style shader & questions about provided uniforms
« on: October 19, 2020, 03:43:19 am »
Hi There!

I've recently adapted Timothy Lottes' RetroArch CRT-style shader (example down below, picture taken from the libretro docs) for OpenXcom, and I'm pretty happy with it so far. One small thing I'm having trouble with: What's the difference between rubyInputSize and rubyTextureSize? As far as I can tell, using either as the input resolution results in exactly the same output. Is there a reason I should use one and not the other?

Second question: I've ripped out the screen warp effect of Lottes' shader, emulating the curvature of CRTs, just because I personally don't like the looks of it. How do you feel about it and should I include a second version of the shader with warp?

Thank you so much!


Offline brown7

  • Squaddie
  • *
  • Posts: 1
    • View Profile
Re: New CRT-style shader & questions about provided uniforms
« Reply #1 on: September 09, 2021, 06:22:05 pm »
It cannot have a variable property. If you want to pass an attribute or uniform into a fragment, you will need to declare a separate variable attribute.   THREE does most of the hidden "preset" shading on your behalf. You can avoid this by using RawShaderMaterial.   Passing a very large number to a shader is a bad idea. You may lose accuracy. For example, if you pass three traps.Time. Call it a uniform time-lapse and do a sine (time) in your shader, you will get stuck.