Coder Social home page Coder Social logo

sub20hz / cod4-shader-ocean Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xoxor4d/cod4-shader-ocean

0.0 0.0 0.0 7.8 MB

Realtime / dynamic ocean shader, fully customizable in-game via the use of the IW3xo client

Home Page: https://xoxor4d.github.io/projects/cod4-ocean/

C 18.05% HLSL 81.95%

cod4-shader-ocean's Introduction

A Call of Duty 4 - Realtime / dynamic ocean shader, fully customizable in-game via the use of the IW3xo client

Using the shader:

  1. Clone the repo or download as zip
  2. Copy all files into the cod4 root directory
  3. Open the "shader_ocean.gdt" in Asset Manager, compile the material and the xmodel
  4. Compile shaders, "worldfx_ocean" and "worldfx_ocean_unlit" by either using https://xoxor4d.github.io/projects/cod4-compileTools/ or shader_tool directly (https://xoxor4d.github.io/tutorials/hlsl-intro/#compiling)
  5. Place the "ocean_plane" xmodel into your map or apply the material to any other kind of xmodel/terrain patch
  6. Tweak in-game using IW3xo (The shader ships with in-game tweaking enabled, requiring IW3xo to be used, see below to disable this if needed)

Tweaking in-game using the GUI:

  1. Use IW3xo and the built in command "/devgui" -> ocean tab to tweak the shader however you like. Use the export button to export your settings. (root/iw3xo/shader_settings/ocean_settings.txt)
  2. Overwrite the static shader constants inside the #else block (if USE_CUSTOM_CONSTANTS is not defined) in both the vertex and pixelshader. Note that both are sharing 3 of the exported constants.
  3. The shader ships with in-game tweaking enabled, requiring IW3xo to be used. This can be disabled by commenting "//" #define USE_CUSTOM_CONSTANTS in both the vertex and pixelshader.
  4. Disabling USE_CUSTOM_CONSTANTS will enable vanilla cod4 usage. You have to do this before you ship your mod/map.

Tweaking in-game using an addon fastfile:

  • IW3xo supports loading/reloading of fastfiles and its assets in-game

  • Expecting that you already have the shader up and running in your map/mod, do the following:

    • Include the following in your fastfile zone:

    material,dynamic_ocean
    techset,mc_worldfx_ocean
    techset,wc_worldfx_ocean
    techset,worldfx_ocean

    • Modify the shader and recompile it
    • Build the fastfile
    • Load up your map/mod thats including the ocean shader
    • Use the following command to load your zone file: "/loadzone your_zone_name"
    • The ocean shader should now reflect your changes
    • Rinse and repeat

Note:

  • Flat plane models with lots of vertices work best (for obvious reasons)
  • The shader was written to be used with models. It does however work with terrain patches and alike. It just wont look as good.
  • Duplicate shader files and assign them to a new material if you need different settings for different enviroments
  • The _unlit variant will be used in radiant or in-game when r_fullbright is turned on. Please note that the _unlit variant does not support custom shader constants, meaning it cannot be controlled in-game. (use to the addon fastfile method instead)

Project Page:
https://xoxor4d.github.io/projects/cod4-ocean/

IW3xo:
https://xoxor4d.github.io/projects/iw3xo/

Custom CoD4 Compiletools:
https://xoxor4d.github.io/projects/cod4-compileTools/

Discord:
https://discord.gg/t5jRGbj

Credits


Play

cod4-shader-ocean's People

Contributors

xoxor4d avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.